Here we understand the steps of applying a custom ribbon to a form or report in MS Access.
The reports or forms that we use in MS Access are customized to a large extent so that they work well with the kind of database we have. And to make these objects even more relevant to your database, you can add to them customized ribbons as well. These ribbons make use of declarative XML markup that is text-based and is used for simplifying the process of creating and adding customizations to the ribbon. To create a user-friendly interface, you need just a few lines of XML, as there is scope for flexibility in customizing the interface of your ribbon in MS Access. These customization markups can then be stored in an Access database, in a table, linked to an Excel Worksheet, or be embedded over a VBA procedure.
Here we will be explaining the procedure of adding customized ribbons to Access Forms or Reports while loading them.
Ensuring Availability of Ribbon Customization XML
Using USysRibbons Table for storing Ribbon Extensibility XML
There are different methods that can be used for making the ribbon customizations available, one of them is to make use of a USysRibbons table. This will allow you to implement these customizations without using a VBA code or a macro.
USysRibbons is a system table that is created by the user themselves. However, there are certain conditions that you need to keep in mind when creating this table.
- It should have specific column names, for example, ‘RibbonName’, and ‘Ribbon XML’, to ensure that the customizations are implemented smoothly on the ribbon.
- These columns should have a defined data type and should contain only valid and relevant information.
Using LoadCustomUI method for loading Ribbon Extensibility XML
You can also opt for programmatically loading the ribbon extensibility XML with the use of LoadCustomUI method. This will require you to first have a module in your database that makes use of the LoadCustomUI method for providing the name as well as the XML customization markup for the ribbon.
You can get the XML markup from the Recordset object that has been created using a table, or from an external source like an XML file parsed in a string. You may also make use of an XML markup that has been embedded directly in the procedure. Once this is done you can opt for creating several ribbons by the same method. Just make sure that each ribbon has a unique name, and the ID attributes of all tabs that are used for making up the ribbon are also unique.
Once this procedure is complete, you can opt for creating AutoExec Macro that implements the procedure through the RunCode action. This will make the LoadCustomUI method applicable automatically when the application is launched, thus making all the ribbons available to the application.
Applying Custom Ribbons to Access Forms and Reports
- Make sure that the customized ribbon is available with Access.
- Open the object in Design View
- In the Design Tab, select Property sheet.
- In the All tab in Property Window, select Ribbon Name list, and select any ribbon.
- Save before closing, and then reopen object.
Encountering a corrupted Access database is a highly probable event for a regular Access user. However you can effectively save your data despite an incident of Access corruption if you keep a powerful tool like DataNumen Access Repair to fix mdb database files.
Vivian Stevens is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including sql repair and excel recovery software products. For more information visit www.datanumen.com