Access VBA Macro Programming

(Joao Candeias) #1
When you open the form where you referenced the ribbon name property to this record,
you will see that an extra entry now appears on the menu called Contoso. Your screen should
look like Figure 11-4. If you click this, you will see a ribbon with three groups in it.
The first and second groups that you see are exact copies of existing ribbon groups. The
Copy group is exactly the same as if you had clicked Home on the menu and then looked at
the group Copy. Similarly, the new Font group is exactly as shown when you click Home on
the menu and see the Font group. This part shows how you can leverage existing ribbon
functionality to build a custom ribbon.
The third group in your new ribbon is a custom group, and this shows the real power
of the ribbon. By looking at the XML, you can see that three buttons have been created:
ConBold,ConItalic, andConUnderline.
If you try clicking any of these buttons, you will receive an error message stating Access
cannot run the macro. This is a piece of code defined by theonActionparameter, and at the
moment this does not exist.

134 Microsoft Access 2010 VBA Macro Programming


Figure 11-3 The XML screen for a custom ribbon
Free download pdf