How to Hide the Access Ribbon After Closing a Query
Question details
The user needs to keep the Microsoft Access Ribbon hidden after opening and subsequently closing a query in design mode.
- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A database is configured to hide interface elements, but users need to input dates via a query in design mode. Closing this query leaves the Ribbon exposed.
- Observed behavior
- Opening a query in design mode forces the previously hidden Ribbon to become visible, and it incorrectly remains visible after the query is closed.
Ensure you have a backup of your Access database before modifying VBA code or form event properties to prevent accidental loss of interface accessibility.
Use the Form's Active Event Property to Re-hide the Ribbon
This solution triggers a VBA command automatically whenever your main form regains focus, ensuring the Ribbon is hidden immediately after closing the query.
By utilizing the 'On Activate' event of your primary form, you can instruct Access to re-apply your UI restrictions the moment the user returns from the query view. This is highly effective when design mode is strictly required for user inputs like dates.
Right-click your main navigation form in the Access navigation pane and select 'Design View'.
Press F4 to open the Property Sheet. Ensure the selection type at the top of the Property Sheet is set to 'Form'.
Navigate to the 'Event' tab in the Property Sheet, find the 'On Activate' property, and click the ellipsis (...) button to open the VBA editor.
In the VBA window, input the command to hide the Ribbon, such as DoCmd.ShowToolbar "Ribbon", acToolbarNo. Save the module and test the form.
Generate Dynamic SQL for the Form's RecordSource
Avoid exposing query design mode entirely by generating SQL strings directly in VBA and assigning them to the form's RecordSource.
Looking for a Lightweight Office Suite? Try WPS Office
While Microsoft Access handles complex relational databases, for your everyday document processing, spreadsheet data analysis, and presentations, WPS Office offers a free, lightweight, and highly compatible alternative. Enjoy a familiar tabbed interface without heavy system requirements.
- 1. Download the Installer: Visit the official WPS Office website and click the Free Download button.
- 2. Install the Software: Run the downloaded executable file and follow the on-screen instructions.
- 3. Open Your Documents: Launch WPS Office to instantly view and edit your existing Office files seamlessly.

Frequently Asked Questions
Why does opening an Access query in design mode unhide the Ribbon?
Microsoft Access automatically exposes built-in interface elements like the Ribbon when entering design environments (such as Query Design or Form Design) so that users have access to necessary development tools and contextual tabs.
Can I hide the 'File' and 'Tell me what to do' tabs in Access using VBA?
Hiding core application-level elements like the File tab (Backstage view) usually requires implementing a custom XML Ribbon configuration rather than relying on simple DoCmd.ShowToolbar VBA commands.
Will Microsoft Word mail merge work with parameterized Access queries?
Word often struggles to natively recognize parameterized Access queries via standard OLE DB connections. Using dynamic SQL to populate a temporary static table in Access is a common and reliable workaround for mail merges.
What is the difference between DoCmd.ShowToolbar and customizing Ribbon XML?
DoCmd.ShowToolbar can quickly hide or show the entire default Ribbon at once, whereas customizing the Ribbon XML allows granular control over individual tabs, groups, and specific buttons for a fully tailored user experience.




