5 out of 38 rated this helpful - Rate this topic

How to: Hide the Ribbon When Access Starts

Office 2007

By default, Microsoft Office Access 2007 does not provide a method for hiding the Ribbon. This topic describes how to load a customized ribbon that hides all of the built-in tabs.

To load the customized ribbon when Access starts, you should store its settings in a table named USysRibbons.

The USysRibbons table must be created using specific column names in order for the Ribbon customizations to be implemented. The following table describes the settings to use when creating the USysRibbons table.

Column NameData TypeDescription
RibbonNameTextContains the name of the custom ribbon to be associated with this customization.
RibbonXMLMemoContains the Ribbon Extensibility XML (RibbonX) that defines the Ribbon customization.

The following table describes the Ribbon customization settings to store in the USysRibbons table.

Column NameValue
RibbonNameHideTheRibbon
RibbonXML<CustomUI xmlns="http://schemas.microsoft.com/office/2006/01/CustomUI"> <ribbon startFromScratch="true"/></CustomUI>

Applying the Customized Ribbon When Access Starts

To implement a custom UI so that it is available when the application starts, do the following:

  1. Follow the process described previously to make the customized ribbon available to the application.
  2. Close and then restart the application.
  3. Click the Microsoft Office Button Button image and then click Access Options.
  4. Click the Current Database option and then, in the Ribbon and Toolbar Options section, click the Ribbon Name list and select HideTheRibbon.
  5. Close and restart the application.
Bb258192.vs_note(en-us,office.12).gif  Note
For more information about the Ribbon UI in other Office applications, see Overview of the Ribbon User Interface.


Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Next goal: hide or strip commands for File tab for backstage view
duplicate error
Next goal: hide or strip commands for File tab for backstage view
This solution works well to hide the ribbon, but I am developing an application for MS Access runtime distribution via an ACCDE file.  I don't want or need users to access or even view the File tab (which remains with this solution).  Not only is the File tab a distracting element on my custom form design, it also contains irrelevant and inappropriate commands and functions.  From what I am reading, it's sounding like the File tab can't be hidden.  Is this code to at least hide or kills any of the commands and functions in that backstage view?
Doesn't work
Access 2007 is a disaster.  Ancient VB6 controls that have never been updated (unstable treeview anyone?).  Completely useless "package and sign" feature that doesn't provide any real security.  And of course, this *** article that doesn't work.  Another swing and a miss by Microsoft...
I figured out to restore Ribbons.
I figured out my own questoin below.
Thanks anyway.
How to restore default ribbons after hide the ribbons?
MicheleGo XML code is good, I can hide all the Ribbons. However, the  Access Options button at Microsoft Office Button was gone too. I am wandering how to restore the default ribbon if I need to modify the forms...

Any help will be appreciated.



And now for something completely different
I couldn't get this to work for me at all, either in Michele's version or the original version.  I was getting completely frustrated when I discovered:

Docmd.ShowToolBars "Ribbon",acToolBarNo

Now the ribbon is gone and life is good.  Credit for this goes to DustinC who posted it at http://www.pcreview.co.uk/forums/thread-3089845.php

Oh, yeah, and that pesky Navigation Pane?

DoCmd.NavigateTo "acNavigationCategoryObjectType"
DoCmd.RunCommand acCmdWindowHide

:-)
Michele Yo!
MicheleGo's code worked like a charm - thx!!
XML is case senstivie
The name space in the example is wrong.

<CustomUI xmlns="http://schemas.microsoft.com/office/2006/01/CustomUI"> <ribbon startFromScratch="true"/></CustomUI>
***********
this should be customui
Different way works, HOWEVER
marilynm, your different way worked, however, it seems to alternate each time I open the database (one time the ribbon is off, next time it is on) . Is there just a macro that will accomplish the same thing without having to enable "Trusted Locations?




An entirely different way to hide/show ribbon using Shift-F1
This is not exactly the same thing, but this toggle code is really simple, and allows Access 2007 to alternately hide or show the ribbon:

I create a function shown below, and then I create a HideShowRibbon macro to call this logic:

Function HideShowRibbon()
SendKeys "^{F1}", True
End Function

From the AutoExec macro, I then call this HideShowRibbon macro so that Access launches without the ribbon showing.

The HideShowRibbon macro adds some ad-hoc utility to be able run this as needed, not only at the start of the session.

I hope this helps. Cheers!
Show the hidden USysRibbons Table after creation
To show the hidden table (which is actually not "hidden", but rather considered a system object), right click the top of the Navigation Bar by the little drop-down arrow, and on the menu which appears click 'Navigation Options'. Then simply go to the 'Display Options' section at the bottom and check the box for 'Show system objects'. You can also choose to show hidden objects from this interface. Then just hit 'Ok' as usual.

You'll now see the full list of system objects, some of which will be grayed out and one of which will be called USysRibbons, which is the one you want.
Adobe Ribbon
This didn't seem to effect the adobe acrobat plug-in ribbon. I'm building a distributable application and can not have these foreign ribbons available.

Is there a way to truly hide all plug-in and native ribbons? I need this to look like a clean application with no ribbons other than what I provide.
How to restore the ribbon
>This worked great for hiding my ribbon, but now how do I restore it?

To restore it just change <ribbon startFromScratch="true"> to false, I know 2003 very well and I've started TODAY with ACC2007 but I'm pretty sure the field content can be updated through code :)

This way Im trying to show/hide the ribbon on a user group basis (admin vs user) :)

Where did the USysRibbons table go and simplifying MicheleGo's code

Okay, just transitioning to 2007 from 2003, so a little growing pain...

:

First, before experimenting with a database, make a copy of it and experiment on the copy (should go without saying but even experienced developers get lazy).

:

The article directs creating a USysRibbons table containing a "RibbonName" text field with a value of "HideTheRibbon" and a "RibbonXML" memo field with a code string as noted in the article.

:

Lessons learned:

:

Creating the table (Create > Table), if one is not careful, will inadvertently create a table with two fields as desired, but instead of being named RibbonName and RibbonXML, they'll be named Field1 and Field2 each containing the values RibbonName and RibbonXML respectively. If creating the table in this manner, right-click on "Field1" and change the name to RibbonName then right-click on "Field2" and change its name to RibbonXML and enter the appropriate value for each in the first row. DO NOT SAVE THE TABLE WITHOUT READING THE SECOND PARAGRAPH FOLLOWING.

:

Another way to create the table, and perhaps safer, is Create > Table Design where it's difficult to misname the two fields (remember that RibbonName is a Text field while RibbonXML is a Memo field). After saving the table (BUT DO NOT SAVE THE TABLE WITHOUT READING THE NEXT PARAGRAPH), you'll have to open the table and provide the values for RibbonName and RibbonXML and then close the table.

:

Once the table is created, we're instructed to save it as USysRibbons. Funny thing is, if you do that, the table "disappears"--it's there but not visible and thus can't be edited (at least I haven't found a way to directly edit USysRibbons). Instead, save the table as Copy_USysRibbons--no need for a primay key, so decline that option when offered while saving the table. Now, right-click on Copy_USysRIbbions table in the Navigation Pane under the Tables section and select Copy, then right-click on white space in the Navigation Pane and select Paste. Ensure the option for Structure and Data is enabled and remove "Copy_" from the table name before clicking OK. Yes, you won't see the USysRibbons table--it's one of those now you see it, now you don't phenomena--but at least you still have the Copy_USysRibbons table to modify and experiment with.

<EDIT> To make the USysRibbons Table visible in the Navigation bar:-
  1. Click the Microsoft Office Button and then click Access Options.
  2. Click the Current Database option and then, in the Navigation Options section, make sure "Show System Object" is selected.
  3. Close and restart the application.

</EDIT>

:

Creating the Copy_USysRibbons table also makes it convenient to import the table into other databases so one doesn't have to go through the minutia of recreating USysRibbons table for each database that needs a restricted user interface (RUI). Once imported, just copy the table over to USysRibbons and pick up with the last paragraph below.

:

One more comment. MicheleGo is right-on about the code, but her example can be simplified and entered on a single line:

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

Once the USysRibbons table is created from the Copy_USysRibbons table, follow the rest of the article following "Applying the Customized Ribbon When Access Starts" and beginning with step 2.

MSDN need to change the article

The MSDN example doesn't work but MicheleGo's does. MSND change your article to avoid confusion. How can I avoid a http call for offline users?

[Noelle Mallory - MSFT] Please post questions to the MSDN Forums at http://forums.microsoft.com/msdn. You will likely get a quicker response through the forum than through the Community Content.

it's case sensitive
XML is case sensitive, and although the example above has upper-case characters, the element names have to begin with lowercase letters, as in MicheleGo's example.
Not Working for Me.

I followed the example, but I still have the Home Ribbon. Am I doing something wrong, or is the Home Ribbon always there?

Works only....

.... if you add the following XML

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

Seems that Access 2007 doesnt recognize the "/>" as the end of "<Ribbon" tag.

It worked for me
It worked for me ... but you must follow the example exactly ... using the exact table name, column names, and values listed in the article.