Next qdfrst.CloseCopy the filled table to the calling database so it will be available for printing in the calling
database:
strTable = “zstblQueryAndFieldNames”
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 = “zsrptQueryAndFieldNames”
DoCmd.OpenReport strReport
End IfErrorHandlerExit:
Exit FunctionErrorHandler:
MsgBox “Error No: “ & err.Number _
& “; Description: “ & err.Description
Resume ErrorHandlerExitEnd FunctionList Table Fields ......................................................................................................
The ListTableFieldsfunction (called from the USysRegInfo table) lists the fields in all the
tables in the database, using the TableDefs collection of the DAO object model:
Public Function ListTableFields()
‘Called from USysRegInfoOn Error Resume NextCall CopyListObjects
Set dbsCode = CodeDb
Set dbsCalling = CurrentDbCreating Access Add-ins 14