Access 2010 and Menu Bars

PRD

Registered User.
Local time
Today, 16:14
Joined
May 18, 2011
Messages
72
Hello, we just upgraded to Access 2010 from Access 2000. Most of my users are volunteers who know nothing about Access or databases and so I like to restrict them to as few options as I can - including MenuBars and ToolBars. In Access 2000 I coded the following to hide (and show) MenuBars...


' Hide Menu bar and the Tool bars

DoCmd.ShowToolbar "Menu Bar", acToolbarNo
DoCmd.ShowToolbar "Form View", acToolbarNo
DoCmd.ShowToolbar "Web", acToolbarNo
DoCmd.ShowToolbar "Print Preview", acToolbarNo

This code worked fine in Access 2000 but doesn't seem to work in Access 2010. Can you tell me how I can hide and show MenuBars/Ribbon in 2010?

Also, can you direct me to a good Weblink which will tell me what programming commands/functions I can use in Access 2010? Thank you for your time.
 
If you right click the FILE button on the top of the ribbon , click the MinimizeRibbon which will do what it says until you click again ./
The onload i use the following which i found on this forum .
If Not CommandBars.GetPressedMso("MinimizeRibbon") Then
CommandBars.ExecuteMso "MinimizeRibbon"
End If
 
ypma -

Thx for the tip, works great.

I have another question though, how can I Maximize the Ribbon as CommandBars.ExecuteMso ("MaximizeRibbon") does not seem to work.

The reason I ask is that I use a 'Print Preview' function on one of my screens but the ribbon always comes up minimized and the user cannot close the window unless he manually clicks on the 'Print Preview' icon to maximize the ribbon and then he must click on the 'Close Print Preview' icon.

You would think that if Microsoft can create a "MinimizeRibbion" command they could also create a 'MaximizeRibbon" command. Thx.
 
From what I see in Access Help, the "MinimizeRibbon" is the parameter passed to the CommandBars.ExecuteMSO method, identifying which commandbar command to execute. If you right-click the File menu, you'll notice that the "Minimize the Ribbon" option is a toggle, with the value indicated by a checkmark. There's no corresponding "Maximize the Ribbon" option. Minimize is either On or Off. So, to turn it off, just repeat the CommandBars.ExecuteMso "MinimizeRibbon" command. I don't know how to tell its existing value.
 
nschroeder -

Thanks but the thing is I don't want my users to see the ribbon at all for fear they will just start pressing the icons to see what happens. The only time I want to display the ribbon is on the 'Print Preview' screen so they can close the window. In Access 2000 I could use the DoCmd.ShowToolbar "Print Preview", acToolbarYes/No commands to control this but it seems Access 2010 won't allow this.
 
nschroeder -

Thanks again for the tip, I will certainly give it a try, however hiding the ribbons through the Office Menu options will probably be an 'all or none' fix. My problem is that there are times when I want to hide the ribbon and other times when I want to show the ribbon. Don't know why you can't do this through Module VBA code like you could in Access 2000.

In fact what I would really like to do is hide the actual Menu Bar and not just the Ribbon. Have you come across any way to do this? Just curious.
 
Maybe my terminology is messed up, but I thought the Ribbon replaced the 2003 Menu Bar, so I'm not sure what you are referring to. If you had created custom menu items in 2003, they would appear under the Add-Ins tab on the ribbon. Maybe you're referring to the Quick Access Toolbar?
 
nschroeder -

SUCCESS at last (more or less)!

To get the program to do what I wanted I did the following two things...

First, I went into the Customize Ribbon Options as per your suggestion and I hid ALL of the Ribbon Main tabs except the ‘Print Preview’ tab. (Again, my rationale for doing this is I want my users to have as few options as possible).

Second, I coded the following Module to show the Ribbon (I found this code on the same link you suggested written by marilynm on 3/1/2010)…

Function ShoPrintBar()

If CommandBars.GetPressedMso("MinimizeRibbon") Then

SendKeys "^{F1}", True

End If

End Function

I then included this Module in the ‘Print Record’ Macro I use to print. It isn’t a pretty solution but it works for me.

There are two minor inconveniences however. One, I have to hide the Ribbon Main tabs on a user-by-user basis as they don’t seem to carry over at the database level (even though hiding the Navigation pane does). But this is no big deal because I do it one time for each user and they’re set.

The second inconvenience is that for some reason after the first printing the “Close Print Preview’ icon on each subsequent Ribbon is dim and I cannot close the window using the icon. Instead I have to close the window by clicking on the ‘X’ in the upper right-hand corner. But I can live with this.

So thanks again for all of your help, it is greatly appreciated. Ciao.
 
I also meant to thank ypma for giving me this coding tip. Thank you!...

If Not CommandBars.GetPressedMso("MinimizeRibbon") Then
CommandBars.ExecuteMso "MinimizeRibbon"
End If
 

Users who are viewing this thread

Back
Top Bottom