How to Filter an Access Form Using Yes/No Checkboxes
Question details
The user needs to filter records in a Microsoft Access form using unbound Yes/No checkboxes without triggering parameter prompts.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Setting up a form with unbound checkboxes to dynamically filter data displayed from a table with Boolean fields.
- Observed behavior
- Incorrect form or control references cause an unwanted parameter prompt to appear. Additionally, having multiple Boolean columns indicates a table design that may need normalization.
Ensure your form is open in Design View and take note of the exact names of your unbound checkboxes as well as the actual Boolean field names in your underlying table.
Use SQL Query Criteria and Requery in VBA
Set up a dynamic SQL query referencing the form controls and use a VBA macro to requery the data upon checkbox updates.
To properly filter without prompts, the query must specifically point to the open form's controls. Using the correct SQL syntax handles both checked and unchecked states.
Go to the Record Source property of your form, open the query builder, and switch to SQL View.
Insert the condition for your checkbox referencing the full form path. For example: `WHERE (BooleanField = Forms!YourFormName!CheckBoxName OR Forms!YourFormName!CheckBoxName = FALSE)`. Save the query.
In Design View, select your checkbox, open the Property Sheet, and click the ellipsis (...) next to the 'After Update' event. Add the VBA code: `Me.Requery`.
Select the entire form, go to the 'On Open' event, and write VBA code to set your checkboxes to False, followed by `Me.Requery` to ensure a clean filter start.

Build a Dynamic Filter String with VBA
Use a VBA loop to check the state of the checkboxes and dynamically update the form's Filter property.
Looking for a Lightweight Office Suite? Try WPS Office
While Microsoft Access serves specific database management needs, everyday tasks like document processing, data analysis, and presentations require an efficient, comprehensive suite. WPS Office offers a free, lightweight, and highly compatible alternative for handling your Word documents, Excel spreadsheets, and PowerPoint presentations.

Frequently Asked Questions
Why do I get a parameter prompt when filtering my Access form?
This usually happens because the query cannot find the control name specified in the criteria. Ensure you are using the exact syntax `Forms!YourFormName!YourCheckboxName` and that the form remains open when the query runs.
What does 'Me.Requery' do in Access VBA?
The `Me.Requery` command forces the active form to re-read its data source. When placed in the After Update event of a checkbox, it instantly refreshes the displayed records based on the newly updated filter criteria.
Is having multiple Yes/No columns bad database design?
Often, yes. Having many Yes/No columns (Boolean fields) to represent different categories usually violates database normalization principles. A better, scalable design is to create a related table where these options are stored as individual rows rather than column headings.




