Copy the filled table to the calling database so it will be available for printing in the calling database:
strTable = “zstblTableAndFieldNames”
Set tdfCode = dbsCode.TableDefs(strTable)
DoCmd.CopyObject destinationdatabase:=strCallingDb, _
newname:=strTable, _
sourceobjectType:=acTable, _
sourceobjectname:=strTableDoCmd.OpenTable strTablestrTitle = “Table filled”
strPrompt = “Print report now?”
intReturn = MsgBox(strPrompt, vbQuestion + vbYesNo, _
strTitle)
If intReturn = vbYes Then
strReport = “zsrptTableAndFieldNames”
DoCmd.OpenReport strReport
End IfErrorHandlerExit:
Exit FunctionErrorHandler:
MsgBox “Error No: “ & err.Number _
& “; Description: “ & err.Description
Resume ErrorHandlerExitEnd FunctionOther Procedures ....................................................................................................
The SetPropertyand GetPropertyfunctions are called from various procedures in the add-
in to save values to custom database properties, or retrieve values from them:
Public Sub SetProperty(strName As String, lngType As Long, _
varValue As Variant)
‘Called from various proceduresOn Error GoTo ErrorHandlerAttempt to set the specified property:
Set dbsCalling = CurrentDb
Set prps = dbsCalling.Properties
prps(strName) = varValueErrorHandlerExit:
Exit SubCreating Access Add-ins 14