Fix Microsoft Access Form Buttons That Cannot Show or Hide the Ribbon
Question details
Restore Microsoft Access form buttons that show and hide the Ribbon.

- Product
- Microsoft Access
- Device & OS
- Windows; version not provided
- Scenario
- A user wants form buttons to control the Access Ribbon after a Windows or Office upgrade.
- Observed behavior
- Buttons that previously controlled the Ribbon no longer work, and attempts to use toolbar constants as Boolean conditions fail.
Open the affected database in Microsoft Access and make sure you can edit the form and its VBA event procedures. If Access displays a security warning, enable trusted content only if you trust the database.
Enable Built-in Toolbars and Test Separate Ribbon Buttons
Use this method to check the database setting and isolate the show and hide commands before attempting a toggle.
The acToolbarYes and acToolbarNo constants are arguments to DoCmd.ShowToolbar, not Boolean tests for the Ribbon's current visibility.
In Access, open File > Options > Current Database. Under Ribbon and Toolbar Options, select Allow Built-in Toolbars, then click OK.
Close and reopen the database so the startup setting can take effect.
Open the form in Design View and add a command button. In its Property Sheet, set On Click to Event Procedure, open the code builder, and place this line inside the button's click procedure: DoCmd.ShowToolbar "Ribbon", acToolbarYes
Add a second command button in Design View and create its On Click event procedure. Place this line inside that procedure: DoCmd.ShowToolbar "Ribbon", acToolbarNo
Save the form, switch to Form View, and click each button separately. Do not use an If statement with acToolbarYes or acToolbarNo as a condition for this test.

Use WPS Office for Everyday Office Files
WPS Office is a free, lightweight alternative with a familiar interface for working with common Office files. It supports migration of documents, spreadsheets, and presentations, but it does not run Access forms or fix Access Ribbon commands.

Frequently Asked Questions
Where can I enable built-in toolbars in Access?
Open File > Options > Current Database, select Allow Built-in Toolbars under Ribbon and Toolbar Options, and click OK. Close and reopen the database to apply the startup setting.
Which VBA commands show and hide the Access Ribbon?
Use DoCmd.ShowToolbar "Ribbon", acToolbarYes to show it and DoCmd.ShowToolbar "Ribbon", acToolbarNo to hide it. Put each command in a form button's On Click event procedure.
Can I use acToolbarYes in an If statement to check whether the Ribbon is visible?
No. acToolbarYes specifies the action for DoCmd.ShowToolbar; it is not a Boolean visibility test. Test separate show and hide buttons first.
Why does setting AllowBuiltInToolbars in VBA produce a property-not-found error?
The database property may not exist. Instead, check Allow Built-in Toolbars under File > Options > Current Database, then reopen the database.




