logo
search
Others

How to Filter an Access List Box Based on Another List Box Selection

Camila MilosovichCamila Milosovich Oct 22, 2026 868 views

Question details

The user needs to populate a second list box based on the item selected in the first list box within a Microsoft Access form.

How to Filter an Access List Box Based on Another List Box Selection
Product
Microsoft Access
Device & OS
not provided
Scenario
Building a form with cascading list boxes where selecting an item (like a teacher) dynamically filters the choices in a second list box.
Observed behavior
The user wants to link two list boxes so the second dynamically filters its records when the first list box's selection changes, avoiding invalid references or parameter prompt errors.
Before you start

Ensure you have named your form controls clearly (e.g., List1, List2) and verify that your database tables have correctly defined primary and foreign key relationships before modifying row sources.

Solution 1Recommended

Update the Row Source and Requery Using VBA

Set up an SQL query as the row source for the second list box and use a simple VBA command to requery it when the first selection changes.

To create cascading list boxes in Microsoft Access, the second list box must use an SQL query that references the value of the first list box in its WHERE clause.

A common mistake is forgetting to refresh the second list box after making a selection in the first one. Adding a short VBA requery command fixes this.

1
Set the Row Source for the second list box

Open your form in Design View, select the second list box, go to the Property Sheet, and enter a Row Source like: SELECT Resource.StudentID FROM Resource WHERE Resource.TeacherID = Forms!YourFormName!List1;

2
Add an After Update event to the first list box

Select the first list box, go to the Event tab in the Property Sheet, and click the builder button (...) next to 'After Update' to open the VBA editor.

3
Write the VBA requery code

In the VBA editor, type 'Me.YourSecondListBoxName.Requery' inside the event sub. This ensures the second list box updates its filtered data whenever the first list box changes.

Update the Row Source and Requery Using VBA
Syntax Check: Always use the exact syntax Forms!FormName!ControlName to reference controls successfully. If Access prompts you for a parameter, this path is likely misspelled.
Free Microsoft Office alternative

Looking for a Free and Lightweight Office Suite?

While Microsoft Access is used for complex relational database management, WPS Office provides an excellent, free alternative for all your core document, spreadsheet, and presentation needs. It is highly compatible with Microsoft Office formats and offers a familiar, user-friendly interface.

  1. 1. Visit the official website: Go to the official WPS Office website to find the correct installation package for your system.
  2. 2. Download the software: Click the Free Download button and wait for the installer to download.
  3. 3. Install and open your files: Run the installer, open WPS Office, and seamlessly view or edit your existing Office files.
Seamless compatibility with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).Free and lightweight software that operates smoothly on various operating systems.Built-in data analysis, filtering, and pivot table tools in WPS Spreadsheet to handle tabular data easily.Familiar tabbed interface for easy multi-tasking across different document types.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Access prompt me for a parameter value when I select the first list box?

This usually happens if the form name or list box control name in your SQL row source is spelled incorrectly. It can also occur if the referenced form is closed when the query runs. Double-check your Forms!FormName!ControlName spelling.

Do I need to use VBA to make cascading list boxes work in Access?

Yes. While you can configure the row source using SQL or the Query Builder, you still need a single line of VBA code (Me.SecondListBoxName.Requery) in the 'After Update' event of the first list box to force the second box to refresh its data.

Can I use a combo box instead of a list box for the first selection?

Absolutely. The logic and process are identical. You can use a combo box for the initial selection and reference its control name in the second list box's row source query.