strTitle = “Table filled”
strPrompt = “Print report now?”
intReturn = MsgBox(strPrompt, vbQuestion + vbYesNo, _
strTitle)
If intReturn = vbYes Then
strReport = “zsrptTableAndFieldNames”
DoCmd.OpenReport strReport
End If
ErrorHandlerExit:
Exit Sub
ErrorHandler:
MsgBox “Error No: “ & err.Number _
& “; Description: “ & err.Description
Resume ErrorHandlerExit
End Sub
Once you have created the XML code and stored it in the USysRibbons table, and written any
needed callback procedures to run from command buttons on the Ribbon, you need to close the
database and reopen it, to load the customized Ribbon(s). Then you have to select the Ribbon you
want to use in the database, as described here:
- Close the database, then reopen it.
- Click the Office button, then the Access Options button (Figure 15.7).
FIGURE 15.7
Opening the Access Options screen.
Customizing the Ribbon with XML in Access Databases and Add-ins 15