Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSAccess - Minimize the Toolbar Ribbon OnLoad()?

Tags:

vba

ms-access

I'm looking for a reliable method to minimize the default MSAccess Toolbar Ribbon during the OnLoad() event.

I realize can totally HIDE the toolbar, but that's not exactly what I am looking to do - I just want to minimize the ribbon:

DoCmd.ShowToolbar "Ribbon", acToolbarNo    'Hides the full toolbar
DoCmd.ShowToolbar "Ribbon", acToolbarYes   'Show

I've tried a couple approaches, with mixed success:

In Access 2010 & 2013 (VB7):

CommandBars.ExecuteMso "MinimizeRibbon"

Earlier Versions:

SendKeys "^{F1}", False

Both of these approaches appear to operate as a TOGGLE between sessions. Is there a method to determine the current state and then apply the appropriate code?

I have users with Access: 2007, 2010, 2013

Thanks for any suggestions!

Mark

like image 765
Mark Pelletier Avatar asked Aug 14 '13 19:08

Mark Pelletier


People also ask

How do you minimize the Ribbon in access?

Choose the Microsoft Office Button. , and then choose Access Options. Choose the Current Database option and then, in the Ribbon and Toolbar Options section, choose the Ribbon Name list and select HideTheRibbon.


1 Answers

Access 2010 version and up you should do this in your start-up form. If you just use the ExecuteMso line ONLY it will TOGGLE your Ribbon each time that form opens. To always minimize the Ribbon on Startup then I use the following code.

If CommandBars("ribbon").Height > 100 Then
    CommandBars.ExecuteMso "MinimizeRibbon"
End If

Hope this Helps some who is looking for the answer to this like myself

Dave

like image 182
Dave Stuart Avatar answered Oct 12 '22 21:10

Dave Stuart