Chapter 29: Customizing Access Ribbons
1029
Case “lblCompanyLocation”
label = “Location: “ & DLookup(“City”, “tblContacts”) _
& “, “ & DLookup(“State”, “tblContacts”)
End Select
End Sub
A control’s id property, of course, is the name assigned to the control in the XML:
<labelControl id=“lblCompanyName” getLabel=“onGetLabel”/>
<labelControl id=“lblCompanyLocation” getLabel=“onGetLabel”/>
Because the id properties are different, both of these Label controls use the same callback proce-
dure. The callback uses the id to determine which label has triggered the callback.
Because the getLabel attribute specifies where the control gets its text, the getLabel attribute
could be just as easily written as follows:
<labelControl id=“lblHello” label=“Hello!”/>
In this case, no callback is used, and the label is filled with a literal text string.
Step 3: Create the USysRibbons table
Access looks for a table named USysRibbons to see whether there are any custom ribbons in the
current database application. This table does not exist by default, and, if present, contains the XML
that defines the custom ribbons in the application.
Note
USysRibbons is hidden in the Navigation Pane by virtue of the USys prefix in its name (any database object
with USys as the first four characters of its name is automatically hidden in the Navigation Pane). If you want
to see USysRibbons in the Navigation Pane, you must enable Show System Objects in the Navigation
Options: Right-click on the Navigation Pane title bar, select Navigation Options, and select Show System
Objects in the lower-left corner of the Navigation Options dialog box.
USysRibbons is very simple, and contains only three fields, shown in Table 29.1.
TABLE 29.1
The USysRibbons Table Design
Field Data Type
ID AutoNumber
RibbonName Text 255
RibbonXML Memo