Thủ tục "Fields Bảng Danh sách", "Danh sách truy vấn Fields", "Chọn Tùy chọn", "Sao lưu cơ sở dữ liệu hiện tại", và "Sao lại kết thúc cơ sở dữ liệu" nút tương tự như những người trong Extras add-in , ngoại trừ việc họ | Creating Access Add-ins 14 On Error Resume Next acCmdSizeToFitForm On Error GoTo ErrorHandler intChoice Nz Me BackupChoice 2 Select Case intChoice Case 1 Me cmdCustomBackupPath .Enabled False Case 2 Me cmdCustomBackupPath .Enabled False Case 3 Me cmdCustomBackupPath .Enabled True End Select ErrorHandlerExit Exit Sub ErrorHandler MsgBox Error No _ Description Resume ErrorHandlerExit End Sub Private Sub fraBackupOptions_AfterUpdate On Error GoTo ErrorHandler intChoice Nz Me fraBackupOptions .Value 2 strBackupChoice CStr intChoice strBackupPath Nz Me BackupPath Select Case intChoice Case 1 Me cmdCustomBackupPath .Enabled False Case 2 Me cmdCustomBackupPath .Enabled False Case 3 Me cmdCustomBackupPath .Enabled True End Select 485 Part III Adding More Functionality to Office Save the user s choice to a database property in the calling database. Set dbsCalling CurrentDb strPropName Backupchoice Call SetProperty strName strPropName _ lngType dbText varValue strBackupChoice ErrorHandlerExit Exit Sub ErrorHandler MsgBox Error No _ Description Resume ErrorHandlerExit End Sub basExtras Module The basExtras standard module contains functions that are called from the USysRegInfo table Public Function ExtrasOptions Called from USysRegInfo menu add-in On Error GoTo ErrorHandler Dim strBackEndSyntaxChoice As String Dim strBackEndSyntax As String Dim strBackEndPathChoice As String Dim strBackEndPath As String Dim strDefault As String Get info from database properties in the calling database and write them to zstblBackupChoices in the code database for use as form s record source Set dbsCalling CurrentDb strPropName BackupChoice strDefault 2 strBackupChoice GetProperty strPropName strDefault Backup choice strBackupChoice strPropName BackupPath strDefault strBackupPath GetProperty strPropName strDefault Backup path strBackupPath strTable zstblBackupChoice Set dbsCode CodeDb Set rst .