Fix Access Runtime Error 3709 When Clearing a Subform Filter
Question details
The user needs to resolve an issue where clearing or reapplying a filter on a subform triggers a runtime error.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Using VBA code to clear or reapply a filter on an Access subform by setting the filter text to an empty string.
- Observed behavior
- Microsoft Access throws Runtime Error 3709 ('The search key was not found in any record') when the filter is cleared while the FilterOn property remains enabled.
Before modifying your VBA code, make sure to back up your Access database and identify the specific form and event where the subform filter is being triggered.
Disable the Subform Filter Using the FilterOn Property
The most effective way to clear a filter without triggering an error is to turn off the filter entirely rather than setting the filter string to an empty value.
Setting a filter to an empty string ("") while the FilterOn property remains set to True confuses the Access database engine. To safely remove the filter from a subform, you must instruct Access to stop applying the filter altogether.
Open your Microsoft Access database, navigate to the form causing the issue, and switch to Design View. Press Alt + F11 to open the VBA Editor.
Find the line of code that attempts to clear the filter. It usually looks something like: Me.SubformName.Form.Filter = ""
Delete or comment out that line, and replace it with code that toggles the filter off: Me.SubformName.Form.FilterOn = False
Save your VBA project, close the editor, and switch your form back to Form View to verify that clearing the subform filter no longer triggers Error 3709.

Correctly Sequence a New Filter Application
If you need to replace an existing filter with a new one, you must assign the Filter property first before setting FilterOn to True.
Add Error Handling as a Fallback
Implement error trapping to handle unexpected filter glitches gracefully without crashing the application.
Looking for a Lightweight Microsoft Office Alternative?
While Microsoft Access handles complex database management, many users simply need a fast, reliable, and cost-effective suite for their daily Word, Excel, and PowerPoint tasks. WPS Office offers an intuitive, tabbed interface and complete compatibility with standard Office files without the heavy resource usage.
- 1. Download the Installer: Visit the WPS Office website and click on 'Download WPS Office Free' to get the installer for your operating system.
- 2. Install the Suite: Run the downloaded file and follow the on-screen prompts to quickly install WPS Office on your computer.
- 3. Open Your Office Files: Launch WPS Office and open your existing .docx, .xlsx, or .pptx files to continue working immediately.

Frequently Asked Questions
Why does setting an Access filter to an empty string cause Runtime Error 3709?
When the FilterOn property is set to True, Access expects a valid SQL WHERE clause string in the Filter property. Passing an empty string confuses the database engine, causing it to fail when attempting to find records matching a blank or non-existent key.
Should I just use an 'On Error Resume Next' statement to ignore this error?
It is not recommended. Suppressing the error with 'On Error Resume Next' might hide underlying issues with your data or syntax. It is always better to fix the root cause by toggling the FilterOn property to False.
Does this fix apply to main forms as well as subforms?
Yes. While the error is frequently encountered on subforms, setting the FilterOn property to False instead of clearing the filter text is the standard best practice for managing filters on both main forms and subforms in Microsoft Access.




