How to: Hide the Ribbon When Access Starts
| Access Developer Reference |
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 Name | Data Type | Description |
|---|---|---|
| RibbonName | Text | Contains the name of the custom ribbon to be associated with this customization. |
| RibbonXML | Memo | Contains 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 Name | Value |
|---|---|
| RibbonName | HideTheRibbon |
| 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:
- Follow the process described previously to make the customized ribbon available to the application.
- Close and then restart the application.
- Click the Microsoft Office Button
and then click Access Options. - Click the Current Database option and then, in the Ribbon and Toolbar Options section, click the Ribbon Name list and select HideTheRibbon.
- Close and restart the application.
Note |
|---|
| For more information about the Ribbon UI in other Office applications, see Overview of the Ribbon User Interface. |
- 8/19/2011
- pestoking
- 5/18/2011
- JMeez
Thanks anyway.
- 11/11/2010
- jpburgundy
Any help will be appreciated.
- 11/11/2010
- jpburgundy
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
:-)
<CustomUI xmlns="http://schemas.microsoft.com/office/2006/01/CustomUI"> <ribbon startFromScratch="true"/></CustomUI>
***********
this should be customui
- 8/12/2010
- kite man
- 8/12/2010
- Thomas Lee
- 3/9/2010
- Tastrophy
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!
- 2/9/2010
- Elliot Davies
- 12/21/2009
- Mytholibar
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) :)
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.
- Click the Microsoft Office Button and then click Access Options.
- Click the Current Database option and then, in the Navigation Options section, make sure "Show System Object" is selected.
- 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.
- 11/28/2008
- ryvyrwynd
- 1/16/2009
- primaveranz
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.
- 1/19/2008
- Ianto
- 1/21/2008
- Noelle Mallory
- 12/12/2007
- Lee Tibbett
I followed the example, but I still have the Home Ribbon. Am I doing something wrong, or is the Home Ribbon always there?
- 10/9/2007
- Stamping Guy
.... 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.
- 7/13/2007
- MicheleGo
- 7/4/2007
- JustListenen
- 7/7/2007
- Igor Leyko
Note