How to Hide the Ribbon and Show Tabs Only with VBA in Access
Question details
Minimize the Microsoft Access ribbon programmatically using VBA so that only tabs appear when an application or report starts.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Setting up a cleaner user interface by collapsing the ribbon automatically upon launching an Access report or application.
- Observed behavior
- The user needs a reliable method to check the ribbon's state and minimize it, displaying only the tabs without manual clicks.
Ensure you have basic familiarity with the Microsoft Access VBA editor. It is recommended to back up your database before adding macro or VBA code to application events.
Use the ExecuteMso Command to Toggle the Ribbon
Run a built-in macro command in the On Load or On Open event to minimize the ribbon to its tabs.
Microsoft Access provides a built-in command to execute Ribbon actions. By triggering the 'MinimizeRibbon' command, you can automatically hide the ribbon controls, leaving only the top tabs visible.
Open your report or form in Design View, select the 'Event' tab in the Property Sheet, and click the builder button (...) next to 'On Load' or 'On Open' to open the VBA Editor.
Inside the event procedure, type the following code: CommandBars.ExecuteMso "MinimizeRibbon"
Save your VBA code and switch the report to Report View. The ribbon should toggle to a minimized state, displaying only the tabs.

Conditionally Minimize the Ribbon Based on Height
Check the current height of the ribbon before executing the minimize command to ensure it doesn't accidentally expand.
Looking for a Free, Lightweight Office Suite?
While Microsoft Access is used for complex database management, everyday document, spreadsheet, and presentation tasks can be handled seamlessly with WPS Office. It offers a highly compatible, free, and lightweight alternative to Microsoft Office.
- 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
- 2. Install the Suite: Run the installer and follow the on-screen instructions to quickly set up WPS Office on your device.
- 3. Open Your Files: Launch WPS Office and directly open your existing Office files without worrying about formatting loss.

Frequently Asked Questions
Can I use the MinimizeRibbon command in Excel or Word VBA?
Yes, the CommandBars.ExecuteMso "MinimizeRibbon" command interacts with the general Office Ribbon UI. It can be used in Excel, Word, and PowerPoint VBA to achieve the same toggling effect.
How do I completely hide the ribbon instead of just minimizing it to tabs?
To completely hide the ribbon in Access, you would typically use DoCmd.ShowToolbar "Ribbon", acToolbarNo. This removes the ribbon entirely, whereas the minimize command only hides the buttons and leaves the tabs visible.
Why isn't my ribbon height check working accurately?
The ribbon height can vary based on your Office version, display scaling, and screen resolution. If the > 128 threshold doesn't work, use MsgBox CommandBars("Ribbon").Height while the ribbon is expanded to find the exact pixel height for your specific environment.




