Ribbon Creation in Access 2007

Overview

This article walks through creating your own custom ribbon for Microsoft Access 2007. It is based upon this article: Customizing the Office Fluent User Interface in Access 2007.

Walk-Through

1. Create a table in your database with two fields. Save this table as USysRibbons. You may want to make this a hidden table.

Field NameData Type
RibbonNameText(255)
RibbonXMLMemo

2. In the USysRibbons table, create a new record with a RibbonName of MainMenu and RibbonXML of, for example, the following.

{copytext|RibbonXML}
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
  <ribbon startFromScratch="false">
    <tabs>
      <tab id="tabMain" label="Main Menu" insertBeforeMso="TabHomeAccess">
        <group id="grpOtherClients" label="Other Clients">
          <button id="cmdProjects" label="Projects" onAction="OpenCustomJob" size="large"
            imageMso="ViewsFormView" supertip="Open the Custom Job page"/>
          <button id="cmdLongs" label="Longs" onAction="OpenAcmeJob" size="large"
            imageMso="ViewsFormView" supertip="Open the ACME Job page"/>
        </group>
        <group id="grpSystem" label="System">
          <button id="cmdReports" label="Reports" onAction="OpenReportsForm" size="large"
             imageMso="ViewsReportView" supertip="Open the Reports page"/>
          <button id="cmdExit" label="Exit" onAction="ExitApplication" size="large"
             imageMso="GroupPrintPreviewClosePreview" supertip="Exit the application"/>
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

3. The Main Menu ribbon can now be use for the database by navigating to Office Menu button > Access Options > Current Database > Ribbon and Toolbar Options section > Ribbon Name.

Notes

TagAttributeNotes
ribbonstartFromScratchDetermines whether the built-in Access ribbon tabs are removed before creating this ribbon
tabinsertBeforeMsoSetting this to TabHomeAccess positions this ribbon before the built-in Home tab. Tab names can be determined from the attached spreadsheet.
buttononActionThis is the name of the macro to run when the button is clicked
buttonsizeEither large or normal
buttonimageMsoValid values can be found in the attached spreadsheet.
  • ViewsFormView = Form icon
  • ViewsReportView = Report icon
  • GroupPrintPreviewClosePreview = close button
  • QueryRunQuery = Exclamation point

  • Reference