Others

Filter an Access Subform with Cascading Combo Boxes

Khadija KhanKhadija Khan Nov 14, 2026 869 views

Question details

Configure two cascading combo boxes to filter the records displayed in a Microsoft Access datasheet subform.

Filter an Access Subform with Cascading Combo Boxes
Product
Microsoft Access
Device & OS
not provided
Scenario
A user selects a value in the first combo box, then selects a related value in the second combo box to filter a datasheet subform.
Observed behavior
The combo boxes work together, but selecting the second value does not update the datasheet subform.
Before you start

Open the parent form in Design View and identify the names of both combo box controls and the subform control. Check the table and field names used to relate the selections to the records you want to display.

Solution 1Recommended

Requery the cascading combo box and datasheet subform

Use form controls as query criteria and refresh the dependent controls in each combo box's After Update event.

The example assumes a parent form named frmFilter, unbound combo boxes named cboFirst and cboSecond, and a subform control named subRecords. Replace these names and the example table and field names with your own.

The example uses numeric IDs. Configure each combo box so its bound column returns the ID used by the queries. The subform may show no records until both selections have values.

1
Set the second combo box's row source

In Design View, select cboSecond and open Property Sheet > Data > Row Source. Enter: SELECT SecondID, SecondName FROM tblSecond WHERE FirstID = Forms!frmFilter!cboFirst ORDER BY SecondName; Set Bound Column to 1 so the selected value is SecondID.

2
Set the subform's record source

Open the form used by the datasheet subform in Design View. In its Property Sheet, set Data > Record Source to: SELECT * FROM tblRecords WHERE FirstID = Forms!frmFilter!cboFirst AND SecondID = Forms!frmFilter!cboSecond; Save the subform.

3
Add the first combo box event

On the parent form, select cboFirst and choose Property Sheet > Event > After Update. Select [Event Procedure], click the build button (...), and add these lines inside cboFirst_AfterUpdate: Me!cboSecond = Null; Me!cboSecond.Requery; Me!subRecords.Form.Requery. Put each statement on a separate line in the VBA editor without the semicolons.

4
Add the second combo box event

Select cboSecond and choose Property Sheet > Event > After Update > [Event Procedure]. Click (...) and add Me!subRecords.Form.Requery inside cboSecond_AfterUpdate.

5
Test both selections

Save the parent form and switch to Form View. Choose a first value, then a second value, and confirm that the datasheet shows matching records. Change the first value and check that the second selection clears before you choose a new one.

Requery the cascading combo box and datasheet subform
Check the subform control name: In the VBA statements, subRecords must be the name of the subform control on the parent form, which can differ from the name of the form displayed inside it.
Free Microsoft Office alternative

Work with filtered data in WPS Spreadsheets

WPS Office is a free, lightweight alternative for everyday document and spreadsheet work. Its familiar interface and Microsoft Office format compatibility make it easy to move existing files. WPS Spreadsheets can filter tabular data, but it does not fix Access forms or replace this Access subform setup.

Filter tabular records in WPS SpreadsheetsOpen and edit Microsoft Excel XLS and XLSX filesUse a familiar interface for everyday office tasksMove existing Office documents into a lightweight suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does the subform not change when I select the second combo box?

The subform needs to run its query again after the selection changes. In the second combo box's Property Sheet > Event > After Update, add an event procedure containing Me!subRecords.Form.Requery, using your subform control's name.

Why should I clear the second combo box when the first selection changes?

The previous second selection may not belong to the new first selection. In the first combo box's After Update event, set the second combo box to Null before calling its Requery method.

What if Access asks for a parameter when the form opens?

Check the form, control, table, and field names in the Row Source and Record Source SQL. A reference such as Forms!frmFilter!cboFirst also requires the named parent form to be open.

Can the subform be empty until both values are selected?

Yes. With both combo box values used as equality criteria, the example query may return no records while either value is Null. Select both values in Form View to display matching records.