Office Fluent Ribbon Customization in Access 2010

RibbonX customizations in Microsoft Access 2010 have some of the same options that the other Microsoft Office applications have, but with some important differences. As is the case with the other Office 2010 applications, you customize the Access ribbon by using XML markup, and you can use external files that contain XML markup or COM add-ins to integrate ribbon customizations into your application. However, unlike the other Office applications, because Access database files are binary and cannot be opened as the new Office Open XML Formats files, you cannot customize the Access ribbon by adding parts to the database file. For more information about the ribbon in other Office applications, see Overview of the Office Fluent Ribbon.

You have a tremendous amount of flexibility in the way that you customize the ribbon in Access. For example, you can store customization markup in a table or in another Access database, embed it in a VBA procedure, or link to it from an Excel worksheet. You can also specify custom UI for the application as a whole or for specific forms and reports.

Customizing the Access Ribbon

To customize the Access ribbon, you must call the LoadCustomUI method, whose signature looks like the following code.expression.LoadCustomUI(CustomUIName As String, CustomUIXML As String) In the signature, expression returns an Application object, CustomUIName is the name of the Custom Ribbon ID to associate with the markup, and CustomUIXML contains the XML customization markup.

Typically, to create and make the ribbon available to the application, you first create a module in the database with a procedure that calls the LoadCustomUI method, passing in the name of the ribbon and the XML customization markup. The XML markup can come from a Recordset object created from a table, from a source external to the database such as an XML file that you parse into a string, or from XML markup embedded directly inside the procedure. You can make different ribbons by using multiple calls to the LoadCustomUI method, passing in different XML markup as long as the name of each ribbon and the ID attribute of the tabs that make up the ribbon are unique. Once the procedure is complete, you create an AutoExec macro that calls the procedure by using the RunCode action. That way, when the application starts, the LoadCustomUI method is automatically executed and all of the custom ribbons or ribbon elements are made available to the application.

Applying a Customized Ribbon when Access Starts

To implement a custom UI so that it is available when the application starts, do the following:

  1. Follow the process described earlier to make the customized ribbons available to the application.

  2. Close and then restart the application.

  3. Click the BackstageButton tab, and then click Options.

  4. Click Current Database and then, in the Ribbon and Toolbar Options section, click the Ribbon Name list and select a ribbon.

  5. Close and restart the application again to display the ribbon that you selected.

Assigning Custom Ribbons to Forms or Reports

To assign a custom ribbon to a form or report, do the following:

  1. Follow the process described earlier to make the customized ribbon available to the application.

  2. Open the form or report in Design view.

  3. On the Design tab, click Property Sheet.

  4. On the All tab of the Property window, click the Ribbon Name list and then select a ribbon.

  5. Save, close, and then reopen the form or report to display the ribbon that you selected.

    Note

    The tabs displayed in the ribbon are additive. That is, unless you specifically hide the tabs or set the Start from Scratch attribute to True, the tabs displayed on the ribbon in a form or a report are displayed in addition to the existing tabs.

The ribbon in Access 2010 gives users a flexible way to work with database solutions. You use simple, text-based, declarative XML markup to create and customize the ribbon. With a few lines of XML, you can create just the right interface for the user. Because the XML markup is contained in a single file, it is easier to modify the interface as requirements change. You can also improve user productivity by putting the commands where users can easily find them. Finally, the Ribbon adds consistency across your applications, which reduces the time that users spend to learn each application.

Note

For detailed information about how to customize the ribbon in Access, search Access Help for How to topics.