I am hoping someone can give me the VBA code in access 2019 to show the Custom Quick Access Toolbar and hide RIBBON (Hide File, home, create, .... )
In my research I have seen code to hide the main menu/ribbon, and which also hides the custom QAT:
DoCmd.RunCommand acCmdWindowHide
DoCmd.ShowToolbar "Ribbon", acToolbarNo
However, I want to keep the QAT and only hide the main menu/ribbon.
CodePudding user response:
You can use the following VBA code to hide the ribbon and show the Quick Access Toolbar in Microsoft Access:
Application.CommandBars("Ribbon").Visible = False
Application.CommandBars("Quick Access Toolbar").Visible = True
This code will hide the ribbon and show the Quick Access Toolbar. If you want to show it again, you can change the value to True for both.
Application.CommandBars("Ribbon").Visible = True
Application.CommandBars("Quick Access Toolbar").Visible = True
You can call this code on the OnOpen or onl oad event of your form, or you could make a button which would toggle the visibility of the ribbon and QAT
You can also use this to hide the menu bar:
Application.MenuBar = ""
And to show it again:
Application.MenuBar = "Menu Bar"