Hide Access 2007 Ribbon but not QAT

redbaron06

New Member
Joined
Aug 6, 2010
Messages
44
Does anyone know if there is a way to hide the Access 2007 Ribbon on Open but not the Quick Access Toolbar (QAT). I would like my users to have access to a few custom buttons on the QAT without being bogged down by the ribbon. Thanks in advance!

Code:
[FONT=Calibri][SIZE=3]Public Function ShowRibbon()[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]DoCmd.ShowToolbar "Ribbon", acToolbarYes[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]End Function[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]Public Function HideRibbon()[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]DoCmd.ShowToolbar "Ribbon", acToolbarNo[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]End Function[/SIZE][/FONT]
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p>[FONT=Calibri][SIZE=3] [/SIZE][/FONT]</o:p>
<o:p>[FONT=Calibri][SIZE=3] [/SIZE][/FONT]</o:p>
[FONT=Calibri][SIZE=3]Private Sub Form_Open(Cancel As Integer)[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]Call HideRibbon[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]End Sub[/SIZE][/FONT]
<o:p>[FONT=Calibri][SIZE=3] [/SIZE][/FONT]</o:p>
[FONT=Calibri][SIZE=3]Private Sub Form_BeforeClose(Cancel As Integer)[/SIZE][/FONT]
<o:p>[FONT=Calibri][SIZE=3] [/SIZE][/FONT]</o:p>[FONT=Calibri][SIZE=3]DoCmd.ShowToolbar “Ribbon”, acToolbarYes[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]End Sub[/SIZE][/FONT]
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
This might get you started. Here is what I did to only show one toolbar.

Background:
My Access app has to be locked down to prevent users from accessing the database window or tweaking code. In 2003 I hide all the toolbars when the app is opened and open a custom toolbar as needed. For example, when a user opens a report I open my custom toolbar. In 2010 this has not been as easy.

Steps Tried:
At first the docmd.showtoolbar "ribbon", actoolbarno appeard to be a great solution, but I have not been able to hide and show like I did in 2003. I tried using the Ribbon Name property, of the report, but no ribbon opens once the showtoolbar code above is run. Also, I tried a macro to show the ribbon. No luck.

Possible solution:
Today I tried creating a custom ribbon by exporting the ribbon code for Print Preview to XML. I entered the code in the RibbonXml column on the USysRibbons table. Next I went to the Ribbon Name (File / Options / Current Database) option and changed it to my custom toolbar. This makes my custom ribbon the only ribbon used by the application. So if execute docmd.showtoolbar "ribbon" actoolbaryes then my custom ribbon is the only one seen.

Drawbacks:
1. The File Tab still appears. Still working on this.
2. This appears to only allow one ribbon to appear. So if you need to toggle or show other ribbons this may not work.

I say appears and may not because I am not sure myself. I am making this post in hopes someone may find a simpler way or an alternative.

Any questions or other solutions please let me know.
 
Upvote 0
Thanks dartagnan! But still have not been able to get it to work - originally the idea was to move the toggle filter button to the QAT and hide the ribbon, because that is the only button that my users will need. I cannot put this directly into the form as the 'filter by form' command disables the button on execution.
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,741
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top