Here is the rest of the post:
Once the xml code is in the table, set which section of code to use in the ribbon either in the properties of a form (On Open) or in the Form_Open section in your code. For example, add to Form_Open:
Me.RibbonName = "PrcPreview"
DoCmd.ShowToolbar "Ribbon", acToolbarYes
to display the PrcPreview ribbon section. This code might be quite simple or include 10-20 icons in the ribbon. This sample includes 14 popular print routines (print, export to Excel, PDF, email etc). Here is the entire PrcPreview section in my USysRibbons table. It has other menu items, but this is the first in its entirety. FYI, I am using Access 2010. If you use an earlier version, set the first line to the right schema year:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" >
<ribbon startFromScratch="true">
<tabs>
<tab id="tabPrintPreview" label="Preview">
<group id="grpPrint" label="Print" visible="true">
<button idMso="PrintDialogAccess" size="large" label="Print" imageMso="PrintDialogAccess"/>
</group>
<group id="grpZoom" label="Zoom" visible="true">
<splitButton idMso="PrintPreviewZoomMenu" size="large"/>
<toggleButton idMso="ZoomFitToWindow" size="large"/>
<toggleButton idMso="ZoomOnePage" size="large"/>
<toggleButton idMso="PrintPreviewZoomTwoPages" size="large"/>
</group>
<group id="grpPageSize" label="Page Size" visible="true">
<gallery idMso="PageMarginsGallery" size="large" />
<gallery idMso="PageSizeGallery" size="large" />
</group>
<group id="grpPageLayout" label="Page Layout" visible="true">
<toggleButton idMso="PageOrientationPortrait" size="large"/>
<toggleButton idMso="PageOrientationLandscape" size="large"/>
</group>
<group id="grpData" label="Data" visible="true">
<control idMso="PublishToPdfOrEdoc" size="large" label="Export to PDF" enabled="true"/>
<button id="btnexporttoexcel" label="Excel" size="large" imageMso="ExcelSpreadsheetInsert" onAction="ExporttoExcel"/>
<button id="btnexporttohtml" label="HTML" size="large" imageMso="ExportHtmlDocument" onAction="ExporttoHTML"/>
<button id="SendviaEmail" label="Email" size="large" imageMso="EnvelopesAndLabelsDialog" onAction="SendViaEmail"/>
</group>
<group id="grpClosePreview" label="Close Preview" visible="true">
<button idMso="PrintPreviewClose" size="large" label="Close Preview" visible="true" imageMso="PrintPreviewClose"/>
</group>
</tab>
</tabs>
</ribbon>
<backstage>
<button idMso="FileCloseDatabase" visible="false"/>
<button idMso="SaveObjectAs" visible="false"/>
<button idMso="FileSaveAsCurrentFileFormat" visible="false"/>
<button idMso="FileOpen" visible="false"/>
<button idMso="FileSave" visible="false"/>
<tab idMso="TabInfo" visible="false"/>
<tab idMso="TabRecent" visible="false"/>
<tab idMso="TabNew" visible="false"/>
<tab idMso="TabPrint" visible="false"/>
<tab idMso="TabShare" visible="false"/>
<tab idMso="TabHelp" visible="false"/>
<button idMso="ApplicationOptionsDialog" visible="false"/>
<button idMso="FileExit" visible="true" label="Exit Database"/>
</backstage>
</customUI>
---Each of my reports uses this ribbon, so I add to each one:
Me.RibbonName = "PrcPreview"
DoCmd.ShowToolbar "Ribbon", acToolbarYes
To stop displaying that ribbon, replace it with another or just use in the On Close section:
DoCmd.ShowToolbar "Ribbon", acToolbarNo
You will also note the the lower section titled "backstage" sets the visible "File" section so all you can do is close the database (FileExit).