Hide/Show Ribbons

Dartagnan

Active Member
Joined
Jun 19, 2002
Messages
386
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.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

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