As per the subject I would like to insert a line on the main form opening to reduce the multifunction bar, to avoid that every time I or whoever uses the created DB has to do it by right clicking the mouse ...
As per the subject I would like to insert a line on the main form opening to reduce the multifunction bar, to avoid that every time I or whoever uses the created DB has to do it by right clicking the mouse ...
I have Google on this laptop.
https://www.google.com/search?q=mini...hrome&ie=UTF-8
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
OK scusa,
ho trovato:
CommandBars.ExecuteMso "MinimizeRibbon"
What can I say
It worked for me.
If you use it when the ribbon is minimised, it will maximise the ribbon. It is a toggle command, so you need to take that into account.
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
Agree with @Welsshgasman
That code line is used to toggle the ribbon state:
I also have code to show/completely hide both ribbon & menus at Manage Taskbar/Nav Pane/RibbonCode:Public Function ToggleRibbonState() If GetAccessVersion > 12 Then 'hide ribbon if visible & vice versa 'doesn't work in Access 2007 (Access 12.0) CommandBars.ExecuteMso "MinimizeRibbon" End If End Function Function GetAccessVersion() As String 'Gets Access version e.g. 12 for Access 2007, 14 for Access 2010 etc GetAccessVersion = Nz(CInt(SysCmd(acSysCmdAccessVer)), "None") End Function Public Function IsRibbonMinimized() As Boolean 'Result: 0=normal (maximized), -1=autohide (minimized) IsRibbonMinimized = (CommandBars("Ribbon").Controls(1).Height < 100) End Function
For example:
As the article title indicates it also has code to manage the taskbar & navigation paneCode:Public Function HideRibbon() 'could run at startup using Autoexec 'however this also hides the QAT which makes printing reports tricky DoCmd.ShowToolbar "Ribbon", acToolbarNo End Function