MS Access – Hide the Ribbon

One more of these common questions in the forums is how to hide the Access application ribbon completely.  As per the usual with Access, this can be accomplished a few different ways:

  • Using VBA
  • Using Ribbon XML

Using VBA

The simplest and easiest way to hide the ribbon completely from the user is to use VBA.  In a single line of code (as shown below) it can be removed.

DoCmd.ShowToolbar "Ribbon", acToolbarNo

and display the ribbon again you simply do

DoCmd.ShowToolbar "Ribbon", acToolbarYes

Using Ribbon XML

Sometimes however, it is nice to have much more control over the ribbon and this is where using custom ribbon XML can become very helpful.  Now Ribbon XML can be setup in various ways (USysRibbons table, User-defined table, XML File, straight from code, …).

Personally, I find using the USysRibbons table the easiest and now include it in all my databases. Then I include a simple ribbon who’s startFromScratch is set to true and has no content (so a blank, non-existent ribbon).

So I normally just import the table from a previous project as quite often the ribbons are useful, but to start a new USysRibbons table from scratch you can simply run the following query

CREATE TABLE USysRibbons (  
     ID              COUNTER,
     RibbonName      TEXT(255),
     RibbonXML       MEMO
);

Then, you can make a new entry in the table.  Provide a RibbonName, I keep it simple and use Blank_Ribbon and then use the following RibbonXML

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
  <ribbon startFromScratch="true">
  </ribbon>
</customUI>

Then it is simply a question of applying it globally to the database File -> Options -> Current Database -> Ribbon and Toolbar Options -> Ribbon Name and selecting the name of the Ribbon we just created.

The next time you open your database, the ribbon will be gone.  The only way to get it back is to use the shift bypass to regain access to the File menu to be able to change the property.

Now your probably saying to yourself “that a lot of work when I could achieve the same thing with a single line of VBA code!?”  Yes, it is, but the difference is that I can then easily add other custom ribbons and apply them to individual database objects (printing ribbon for reports, data export ribbon for certain forms, …) now that I have the framework setup.

So it comes down to your needs.  Are you simply hiding the ribbon and that’s it or are you looking to get into ribbon customization and give your users a custom experience.

4 responses on “MS Access – Hide the Ribbon

  1. Robert Uscroft

    Hi Daniel
    Using Access 2016
    I have used this method with success but it only seems to work with accdb files
    If I convert the file to accde it does not work anymore.
    Can anyone advise how to hide the ribbon in accde databases
    Cheers
    Rob

  2. James Franklin

    Hi Daniel,
    I have the same issue as Rob with this. I have tried both methods and neither of them work when the file is an accde.
    Does anyone have a solution to this?
    Cheers,
    Jim

  3. EZ Access Gideon

    Hi,
    I use Daniel’s solution regularly in combination with accde files. I never had any issue with this. Maybe it is some kind of combination of settings?
    EZ Access Gideon

  4. James

    Hi, what if you use the front-end database on another pc, does it show a Security Warning?. if it is showing then the File menu is exposed again (ribbon). Does using Ribbon XML still works?