Microsoft Access Database: How To Really Hide Access 2007 Ribbons With VBA

Microsoft Access Database: How To Really Hide Access 2007 Ribbons With VBA

Let’s start by saying this also applies to Microsoft Access 2010 since it also uses the Fluent Ribbon Bar.

I’m not talking about how to hide or show the Access 2007 ribbons (or Access 2010 ribbons for that matter) but how to really hiding the ribbon bar which requires some simple Access VBA code.

Take a look at the following screenshot which hides the standard hidden ribbon bar but only displays the menu tabs (try it by toggling CTRL + F1 keyboard):

access 2007 ribbonNow take a look at the next screenshot and the ribbon bar is completely gone (including the menu tabs) – requiring one line of Access VBA code:

access 2007 ribbon goneBy the way, did I mention the above screen also hides the Quick Access toolbar?

Microsoft Access Database: How To Really Hide Access 2007 Ribbons With VBA

The following one line of code is added to a form or a report when being opened using the ‘On Open’ event:

vba access 2007 ribbonI’ve also added it the ‘On Close’ event too so it resets Microsoft Access 2007 ribbon bar.

With a bit more creativity, you could make this globally available to all forms and reports or have this code executed when the database file loads and then reset it when exiting the application.

Microsoft Access Database: How To Really Hide Access 2007 Ribbons With VBA

I would love to hear your comments on firstly if you knew this feature existed and secondly, where will you use it? Access 2007 ribbons are easy to use but are not always required especially for forms where you normally control the functionality.

This entry was posted in Forms, Modules, MS Access, Reports, VBA and tagged , , , , . Bookmark the permalink.

6 Responses to Microsoft Access Database: How To Really Hide Access 2007 Ribbons With VBA

  1. Ben says:

    Ribbon UI Fluent was introduced from Access 2007 onwards and does not exist in earlier versions including Access 2003.
    In Access 2003, it uses the traditional menus and toolbars which can be coded in VBA to dynamically change or there is a custom toolbars and menu bars utility which is then bound to forms and reports. In VBA, the object keyword is ‘CommandBars’ which you can contact me on for more help.

  2. Ken says:

    Is this written a different way for 2003, becasue the line you wrote does not function. I get an error message “Microsoft Access can not find the toolbar “Ribbon”. Maybe the Ribbon is called something else in 2003?

  3. Ben says:

    Yes, correct. But it’s good practice to reset this to back ‘on’ when closing the last form before exiting the database file ready for another database file and next session of Access.

  4. Giorgio Rovelli says:

    So if you switch the ribbon off in the open event of the main starting form, it stays hidden even if you subsequently open other forms and/or reports in the same database?

  5. Ben says:

    Hi,
    If you apply the VBA code to the main starting form (i.e. menu or switchboard) using the ‘Open’ event to switch off the ribbon and then switch it back on when closing the form(and system) using the ‘Close’ event, then this will make it global to the database file.
    Another way is to create a VBA procedure as a function and call it via the ‘AutoExec’ macro which will execute when loading the database file too.
    To make it globally available to all databases is not recommended as it should be tied and stored to each database allowing for other database files to edit using the ribbon bar.
    Thanks,
    Ben

  6. Giorgio Rovelli says:

    Hi Ben, how do you make this globally available to all forms and reports?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Confirm you are human.