Office Settings & Configuration

How to Keep an Access Pop-Up Form Visible Without Taking Focus

Huda QurayshiHuda Qurayshi Oct 29, 2026 868 views

Question details

The user wants to open an Access pop-up form based on specific conditions but needs the original main form or a specific subform control to retain or immediately regain focus.

How to Keep an Access Pop-Up Form Visible Without Taking Focus
Product
Microsoft Access
Device & OS
not provided
Scenario
Triggering a pop-up form in Access when a record meets certain criteria without disrupting the user's active workflow on the main form.
Observed behavior
The pop-up form takes focus away from the original form and subform when it opens, interrupting data entry.
Before you start

Ensure you have a basic understanding of Microsoft Access VBA and know the exact exact names of your main form, subform container, and the specific control you want to focus on.

Solution 1Recommended

Return Focus Using VBA in the Calling Form

The most effective way to keep the pop-up form visible without losing focus on your main task is to immediately redirect the focus back to the subform using VBA right after the open command.

When a pop-up form opens, Microsoft Access naturally shifts the application focus to the new window. To counter this, you must explicitly instruct Access to return focus to your original form.

A common mistake is placing the focus code in the pop-up form's Load or Current events. Because of the order in which Access processes form events, this often fails. Instead, the SetFocus code must reside in the calling form right after the DoCmd.OpenForm execution.

1
Open the calling form's VBA module

Open your main form in Design View, right-click the event that triggers the pop-up form, and select Build Event to open the VBA editor.

2
Locate the OpenForm command

Find the DoCmd.OpenForm "YourPopUpFormName" statement in your VBA code.

3
Insert the SetFocus command

Immediately below the OpenForm line, insert the SetFocus command using the specific subform syntax: Forms!mainformname!subformname.Form!controlname.SetFocus

4
Replace placeholder names

Replace 'mainformname', 'subformname', and 'controlname' with the actual names of your Access objects. Note that 'subformname' must be the name of the subform control on the main form, not the source object name.

5
Save and test

Save the VBA module, switch your form back to Form View, and trigger the event to ensure the pop-up opens while the original control remains active.

Return Focus Using VBA in the Calling Form
Syntax Tip: Ensure you include the '.Form!' property in your syntax. This tells Access that you are referencing the form object contained within the subform control.
Free Microsoft Office alternative

Looking for a Reliable and Free Alternative to Microsoft Office?

While Microsoft Access is designed for complex database programming, many everyday data organization tasks can be handled far more efficiently with WPS Spreadsheet. WPS Office provides a lightweight, highly compatible, and free suite for managing data without the steep learning curve of VBA programming.

  1. 1. Visit the official website: Go to the official WPS Office website to download the free, lightweight installer.
  2. 2. Install WPS Office: Follow the straightforward on-screen instructions to install the suite on your preferred operating system.
  3. 3. Open existing documents: Open your existing Microsoft Office files directly in WPS Office to experience seamless compatibility and intuitive editing.
Fully compatible with Microsoft Excel (.xlsx), Word (.docx), and PowerPoint (.pptx) formats.Lightweight installation that runs smoothly on Windows, Mac, and Linux systems.Built-in advanced spreadsheet formulas and data validation for robust, code-free data management.Familiar, intuitive user interface that requires zero learning curve for seamless migration.
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't placing SetFocus in the pop-up form's Load event work?

The Load and Current events of the pop-up form execute while the form is still initializing. Access processes the open event sequence and ultimately grants focus to the new window, overriding any SetFocus commands placed within the pop-up's initialization events. Placing the command in the calling form ensures focus is redirected only after the pop-up has completely opened.

What is the correct syntax to reference a subform control in Access VBA?

The standard syntax to reference a control within a subform from the main form is Forms!YourMainFormName!YourSubformControlName.Form!YourControlName. The .Form property is essential as it explicitly specifies the form object contained within the subform control.

Can I keep the form on top without using VBA?

If you set the 'Pop Up' property of a form to Yes in the Property Sheet, it will always stay on top of other Access windows. However, keeping it on top while simultaneously forcing another window to maintain active input focus still requires VBA or macro actions (like GoToControl) to manage the focus state programmatically.