Others

How to Fix Microsoft Access Running a Query After Closing a Report

Kushani NimanthikaKushani Nimanthika Oct 26, 2026 868 views

Question details

The user needs to stop Microsoft Access from automatically executing a long-running query immediately after closing a filtered report.

How to Stop Microsoft Access from Running a Query After Closing a Report
Product
Microsoft Access
Device & OS
not provided
Scenario
Closing a filtered report that was opened using DoCmd.OpenReport with a WHERE string variable.
Observed behavior
Access unexpectedly runs a query that takes as long as the original opening query, delaying normal operations.
Before you start

Ensure you have Design View permissions for the affected database objects and that no other users are currently locking the report.

Solution 1Recommended

Remove Filter Actions from the Report's Close Event

Use this solution to remove unintended macros or code in the Close event that trigger a requery by removing the applied report filter.

Often, a macro or VBA command is accidentally left in the report's Close event. If this action attempts to remove or alter the active filter, Access is forced to rerun the underlying query against the entire dataset before fully closing the object.

1
Open the report in Design View

Open your database in Microsoft Access, locate the problematic report in the Navigation Pane, right-click it, and select 'Design View'.

2
Access the Property Sheet

Click 'Property Sheet' on the Design ribbon, or press F4 on your keyboard to display the properties pane.

3
Locate the On Close property

In the Property Sheet, click on the 'Event' tab and find the 'On Close' row.

4
Edit the event action

If you see a macro name or '[Event Procedure]' in the 'On Close' field, click the ellipsis (...) button next to it to open the Macro Builder or VBA Editor.

5
Delete the filter removal action

Identify the specific command or macro step that removes the filter, delete it, and save your changes. Close the editor and test the report.

Remove Filter Actions from the Report's Close Event
Database Saved: Once the action is removed, closing the report will no longer trigger the lengthy requery process.
Free Microsoft Office alternative

Boost Your Data Workflow with WPS Office

While Microsoft Access handles heavy database management, WPS Office provides an incredibly fast and lightweight solution for analyzing exported database reports, formatting daily documents, and presenting your data findings without the high subscription costs.

  1. 1. Download the Installer: Visit the official WPS Office website and click the free download button.
  2. 2. Install the Suite: Run the downloaded file and complete the quick, lightweight installation process.
  3. 3. Analyze Exported Data: Open your exported Access reports in WPS Spreadsheets to quickly filter, analyze, and chart your information.
Easily export Microsoft Access report data into WPS Spreadsheets for advanced data analysis and charting.Fully compatible with Microsoft Office file formats, including .xlsx, .docx, and .pptx.Lightweight installation with a familiar, tabbed UI ensuring a seamless migration and zero learning curve.Completely free basic functionality for Word, Excel, and PowerPoint alternatives.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Access report take so long to close?

This usually happens because an action or macro in the 'On Close' event is configured to remove or alter the report's filter. Removing a filter forces Access to rerun the query against the entire underlying table or database before it finishes closing.

Does DoCmd.OpenReport automatically cause a query to run when closing?

No, the DoCmd.OpenReport command itself only dictates how the report opens. If a query runs on close, it is triggered by an event property within the report itself or by a background form regaining focus.

How do I find out if my Access form has hidden focus code?

Open the form in Design View, press F4 to open the Property Sheet, and select the Event tab. Look for entries next to 'On Got Focus', 'On Lost Focus', or 'On Activate'. If it says '[Event Procedure]', click the ellipsis button to view the VBA code.