logo
search
Others

How to Hide and Restore Popup Forms in Microsoft Access

Muhammad TalhaMuhammad Talha Oct 21, 2026 868 views

Question details

The user wants to hide an initial Microsoft Access popup form when opening a secondary detail form, and automatically restore the initial form's visibility when the detail form is closed.

How to Hide and Restore Popup Forms in Microsoft Access
Product
Microsoft Access
Device & OS
not provided
Scenario
Managing user interface flow between multiple popup forms in a database application to prevent screen clutter.
Observed behavior
The user needs to transition smoothly between popup forms without keeping the previous form visible, ensuring it safely restores when returning from the new form.
Before you start

Ensure you have design access to your Microsoft Access database and are familiar with basic Visual Basic for Applications (VBA) events such as On Click and On Unload.

Solution 1Recommended

Use the Visible Property and Form Events

Hide the previous form using VBA code when opening the new form, and restore it using the Unload event of the new form.

This method involves toggling the form's visibility rather than closing it. By keeping the previous form open but hidden, it retains its data and state, making the transition seamless for the user.

1
Open the Form Design View

Open your Access database, navigate to the initial popup form, right-click its tab, and select 'Design View'.

2
Hide the Initial Form

Select the command button used to open the detail form. In the Property Sheet, go to the 'Event' tab, click the ellipsis (...) next to 'On Click', and choose Code Builder. Add the code: Forms!YourInitialFormName.Visible = False right after the DoCmd.OpenForm command.

3
Restore via the Unload Event

Open the secondary detail form in Design View. In its Property Sheet, select 'Form' as the selection type. Go to the 'Event' tab, find the 'On Unload' event, and open the Code Builder. Add the code: Forms!YourInitialFormName.Visible = True.

Use the Visible Property and Form Events
Best Practice: Placing the restoration logic in the Form_Unload event is highly recommended. It guarantees that the previous form is restored even if the user closes the detail form using the standard 'X' window button.
Free Microsoft Office alternative

Need a Free Alternative to Microsoft Office?

While WPS Office does not include a database management tool like Microsoft Access, it offers an exceptional, free alternative for your daily document, spreadsheet, and presentation needs. It features high compatibility with standard Office files.

  1. 1. Visit the WPS Office Website: Navigate to the official WPS Office website to find the free download link.
  2. 2. Download the Installer: Click the 'Free Download' button to get the latest installation package for your device.
  3. 3. Install and Start Creating: Run the installer, follow the on-screen instructions, and start handling your documents with ease.
Free and lightweight Office suiteFully compatible with Microsoft Word, Excel, and PowerPoint formatsFamiliar, tabbed user interface for easy multitaskingBuilt-in PDF editing and conversion tools
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't the previous form restore when using a custom Close button?

If the code to restore the form's visibility is only placed in a custom command button's On Click event, it will not execute if the user dismisses the form using the default window close button ('X'). Using the Form_Unload event ensures the code runs regardless of how the form is closed.

Can I pass data between the hidden popup form and the detail form?

Yes. Even when a form's Visible property is set to False, it remains open in memory. You can continue to read and write data to its fields by explicitly referencing them, such as using Forms!HiddenFormName.ControlName.

What is the difference between hiding a form and closing a form in Microsoft Access?

Hiding a form (setting Visible = False) keeps the form active in the background, retaining all user inputs and its current execution state. Closing a form using DoCmd.Close completely removes it from memory, resulting in the loss of unsaved temporary states.