Access.2007.VBA.Bibl..

(John Hannent) #1
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: “ & err.Number _
& “; Description: “ & err.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)
Debug.Print “Backup choice: “ & strBackupChoice

strPropName = “BackupPath”
strDefault = “”
strBackupPath = GetProperty(strPropName, strDefault)
Debug.Print “Backup path: “ & strBackupPath

strTable = “zstblBackupChoice”
Set dbsCode = CodeDb
Set rst = dbsCode.OpenRecordset(strTable)

Part III Adding More Functionality to Office

Free download pdf