O'Reilly logo

Access™ 2007 VBA Programmer's Reference by Armen Stein, Geoffrey Griffith, Rob Cooper, Teresa Hennig

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12.4. Saving a Custom Ribbon

Because you'll probably want to test your custom ribbon as you build it, let's start by talking about how to use ribbon customizations in Access. The primary way to use a custom ribbon is with a special table named USysRibbons. This section explains how you can create this table.

Access loads ribbon customizations from a USysRibbons table, which contains the fields shown in the table that follows:

Field NameData TypeDescription
RibbonNameTEXTContains the name of a Ribbon that you use in your application. You can specify the name of a Ribbon for a form, report, or database.
RibbonXmlMEMOContains the XML definition for the ribbon customization.

Alternatively, you can create this table using the following SQL statement in a DDL query:

CREATE TABLE USysRibbons
(
    RibbonName TEXT (255) PRIMARY KEY,
    RibbonXml MEMO
);

You can also create application-level Ribbons using a COM Add-in. Appendix C provides more information about writing a COM Add-in to customize the Ribbon.

To define multiple Ribbons in your application, simply add a new record to the USysRibbons table.

There is yet another way to create the USysRibbons table for use in your databases: by creating a database called Blank12.accdb. When you create a new blank database in Access 2007, Access first looks for a file named Blank12.accdb in the Office\Templates directory. If it finds one, it creates a copy of the file for your new Blank Database. If this file contains a USyRibbons table, your new database ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required