Others

How to Filter an Access Form with a Combo Box When It Opens

Emma BrownEmma Brown Oct 26, 2026 869 views

Question details

The user wants to filter an Access form dynamically based on a user's selection from a combo box drop-down list, avoiding the need to build a separate form for every single category or company.

How to Filter an Access Form with a Combo Box When It Opens
Product
Microsoft Access
Device & OS
not provided
Scenario
Opening a target form to display specific records filtered by a value selected in an initial search form's drop-down menu.
Observed behavior
Instead of creating and maintaining dozens of individual forms or macros for each company, the user seeks a unified, dynamic filtering method.
Before you start

Ensure you have your primary data table ready and identify the key field (like CompanyID) that will serve as the linking value between your combo box and the target form.

Solution 1Recommended

Use DoCmd.OpenForm with a WhereCondition (Recommended)

This is the most flexible approach. It uses a simple VBA command on a search form to open your target form filtered to the exact value selected in your combo box.

By utilizing the WhereCondition argument in the DoCmd.OpenForm method, you can dynamically pass the combo box value as a filter without permanently altering the target form's underlying query.

1
Create an unbound search form

Create a new blank form and add a Combo Box control. Name it 'cboCompanySearch' and set its Row Source to the table containing your companies.

2
Add a command button

Place a Command Button on the form next to the combo box. You will use this button to trigger opening the filtered form.

3
Add VBA code to the button's On Click event

Open the Property Sheet for the button, go to the Event tab, and click the ellipsis (...) next to 'On Click'. Choose Code Builder.

4
Enter the OpenForm command

Type the following code: DoCmd.OpenForm "YourTargetFormName", , , "CompanyID = " & Me.cboCompanySearch

Use DoCmd.OpenForm with a WhereCondition (Recommended)
Expandable Strategy: This method makes it incredibly easy to add more combo boxes later. You can simply string multiple conditions together using 'AND' in the VBA string.
Free Microsoft Office alternative

Looking for a Free, Lightweight Office Suite? Try WPS Office

While WPS Office does not include a direct relational database application like MS Access, its powerful Spreadsheet tool provides robust data validation, advanced filtering, and pivot tables. You can easily manage large datasets, create drop-down lists, and dynamically filter records without writing any complex VBA code.

  1. 1. Create Drop-down Lists: Open WPS Spreadsheet, select a cell, and go to Data > Validation to create a drop-down list from a range of cells.
  2. 2. Apply Advanced Filters: Select your dataset headers, click Data > Filter, and use the drop-down arrows to instantly filter records based on specific criteria.
Fully compatible with Microsoft Excel (.xlsx, .xls) filesAdvanced data filtering and custom drop-down list features to mimic database searchesFree, lightweight, and fast to install across multiple platformsFamiliar tabbed interface requiring zero learning curve
microsoft office alternative - wps office

Frequently Asked Questions

How do I filter an Access form using multiple combo boxes?

You can combine multiple criteria by using the AND operator in your WhereCondition. For example: DoCmd.OpenForm "TargetForm", , , "CompanyID = " & Me.cboCompany & " AND Status = '" & Me.cboStatus & "'".

Why is my Access form prompting for a parameter value when it opens?

This usually occurs if the target form's query references a combo box name that is misspelled, or if the search form containing the combo box was closed before the query could read its value. Always keep the search form open while running the filtered form.

Can I put the combo box directly in the header of the target form instead of using a popup?

Yes. You can place an unbound combo box in the form's header. In the combo box's After Update event, write a VBA script to set the form's filter directly: Me.Filter = "CompanyID = " & Me.cboCompany and then enable it using Me.FilterOn = True.