12.6. Creating an Integrated Ribbon

You've examined the different ways in which you can define ribbon customizations using tabs, groups, and controls. Now let's take a look at two scenarios for which you'll customize the Ribbon.

First, you'll create a Report Manager that integrates with the Access Ribbon. The Report Manager provides users with a nice way to view a list of reports that are in the database and provide them with a means to open a report. Second, you'll create your own contextual tab that you can use from a report to add some custom filtering.

Let's get started!

The sample database that implements the report manager is available with the code download for this chapter.

12.6.1. Building the Report Manager

The first scenario has two parts—the Report Manager and the custom filtering for the report. The Report Manager consists of a table to store information about reports, the XML for the Ribbon, and two callback routines.

12.6.1.1. Creating the Reports Table

To manage your reports, you'll create a table that contains the name and a friendly name for each report. To prevent the user from seeing the actual names of the reports, you'll show the friendly names in the menu. Both fields are defined as Text fields. Figure 12-25 shows the sample reports table named tblReports.

Figure 12.25. Figure 12-25
12.6.1.2. Using dynamicMenu

Next, write the XML that will fill the ...

Get Access™ 2007 VBA Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.