Microsoft Access Database: Customize Access 2010 Ribbon Bar – Part 2
In part 1, I introduced you to how you can easily customise the Access 2010 Ribbon Bar which was a video tutorial showing the simple steps.
In this final part, I’m going to explain very quickly how one can bind a Ribbon bar to either a form or report as opposed to the application (as previously explained).
It requires the following steps:
- Creating a special ‘system’ table.
- Creating some XML code using an editor.
- Setting a property to bind Ribbon Bar.
Each step can be covered in much more detail than this blog and will be available as an EzineArticle in due course but for now, here’s the overview.
Microsoft Access Database: Customize Access 2010 Ribbon Bar – The Steps
Customising the Access 2010 Ribbon bar requires some XML knowledge or better still getting Microsoft Access to generate the code for you (a neat little trick).
The first step is to create a table and name it USysRibbons which is a specially reserved system table. You will need to add the following three fields (and data types):
The next step is to create some XML code which will build your Ribbon bar and the best way to do this is to customise the Access 2010 Ribbon bar as shown in part 1 but un-tick all the items you do not want leaving just the table as customised & visible.
Export this feature using the Import/Export command available in the ‘Customize Ribbon‘ section from Options (at the bottom of the screen).
It generates a file called ‘Access Customizations.exportedUI’ and can be opened in a text editor like Notepad.
Copy this code as new record in your new table under the field ‘RibbonXML’ and add a name to the ‘RibbonName‘ field.
Open and restart the database file, reset your main Access 2010 Ribbons back to how you want it to be used as globally across the application and then go to a design view for your form or report.
In the form or report, you need to set the property for the form (or report) called ‘Ribbon Name’ located from the ‘Other’ tab (Property Sheet) and choose the ribbon required.
Close and save the object and restart the application.
You now have a personalised Ribbon bar for a loading form (or report).
Microsoft Access Database: Customize Access 2010 Ribbon Bar
You may need to edited the XML code slightly to help display and arrange the icons and groups required and therefore some XML knowledge will help.
For now though, your get the idea!
Keep a look out for more detailed information at my EzineArticles section and I welcome your comments and experiences when customising Access 2010 Ribbon bars.