Form Ribbons

You can also make form Ribbons, to replace or customize the built-in Ribbons. The Test Ribbon database has a sample form Ribbon, AddButtons. This Ribbon displays for a specific form, after selecting it in the Current Database page of the Access Options screen, and in the form's property sheet. The XML for the AddButtons Ribbon is shown in Figure 15.11.

FIGURE 15.11

The XML code for the custom AddButtons form Ribbon.

FIGURE 15.11

The XML code for the custom AddButtons form Ribbon.

This code adds a custom tab called Custom Form Tab, with a single group and two command buttons. The Built-in Paste button runs the default Paste command (if there is something in the Clipboard to paste); the Click Me button pops up a simple message box. To display a custom Ribbon on a form, you need to select the Ribbon name in the form's RibbonName property, as shown in Figure 15.12.

Selecting a Ribbon for a form.

Form

Form

Modal

Display on SharePoint Site

Cycle _

Ribbon Name Toolbar Shortcut Menu Menu Bar Shortcut Menu Bar Help File Help Context Id Has Module Use Default Paper Size

Fast Laser Printing pfag

Modal

Display on SharePoint Site

Cycle _

Ribbon Name Toolbar Shortcut Menu Menu Bar Shortcut Menu Bar Help File Help Context Id Has Module Use Default Paper Size

Fast Laser Printing pfag

Follow Table Setting All Records

0 No No Yes

TurnOff

Follow Table Setting All Records

0 No No Yes

TurnOff

The custom tab is shown in Figure 15.13.

FIGURE 15.13

A form custom Ribbon with two buttons, and the message box popped up by the Click Me button.

FIGURE 15.13

0 0

Post a comment