Others

How to Filter an Access List Box as Text Box Values Change

Kushani NimanthikaKushani Nimanthika Oct 26, 2026 868 views

Question details

The user needs to filter the results of an Access list box dynamically as they type values into a text box.

How to Filter an Access List Box as Text Box Values Change
Product
Microsoft Access
Device & OS
not provided
Scenario
Filtering records in a form by typing search criteria into a text box, which updates the list box's RowSource query.
Observed behavior
The list box returns no results because the LIKE expression in the query is incorrectly formatted for either text or numeric fields.
Before you start

Ensure your Access form is open in Design View and take note of the exact names of both your List Box and your Search Text Box.

Solution 1Recommended

Filter Alphanumeric Fields Using the Correct LIKE Syntax

Use this method when filtering text-based (alphanumeric) fields to ensure wildcard characters are properly formatted.

When filtering text fields, the SQL query must encapsulate the wildcard asterisks (*) in quotes and concatenate them with the text box value.

1
Open RowSource Query

Select your List Box in Design View, open the Property Sheet, and click the ellipsis (...) next to the RowSource property.

2
Enter the LIKE Expression

In the Criteria row of your alphanumeric field (e.g., 'Code'), enter the following expression: Like '*' & Forms!YourFormName!YourTextBoxName & '*'

3
Add a Requery Event

Select your Text Box, go to the Event tab in the Property Sheet, and add a VBA macro to the 'On Change' event: Me.YourListBoxName.Requery

Filter Alphanumeric Fields Using the Correct LIKE Syntax
Quotation Marks Tip: If you write this directly in VBA, ensure you correctly nest your double quotes, such as: "WHERE Code Like '*" & Me.TextBox_FilterJobList.Text & "*'"
Free Microsoft Office alternative

Analyze Exported Data Easily with WPS Office

While Microsoft Access is a specialized database tool, you can easily export your filtered queries to a spreadsheet for easier sharing and analysis. WPS Spreadsheets offers a free, lightweight, and highly compatible alternative to Microsoft Excel for all your data analysis needs.

  1. 1. Export Your Data: Right-click your filtered Access query, select Export, and choose Excel to save it as an .xlsx file.
  2. 2. Open with WPS Spreadsheets: Launch WPS Office and open your newly exported spreadsheet.
  3. 3. Filter Without Code: Use the Data > Filter tool in WPS Spreadsheets to instantly search and filter your records without writing any SQL or VBA code.
Seamlessly open and edit exported Microsoft Office formats (.xlsx, .csv, .docx, .pptx)Free and lightweight alternative to expensive, heavy office subscriptionsBuilt-in advanced filtering and data processing tools for quick analysisFamiliar user interface ensuring a zero-learning-curve transition
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Access list box turn blank when I start typing?

This usually happens if the list box is not being requeried, or if the LIKE syntax is missing the correct concatenation. Ensure you are using the correct wildcard syntax (`Like '*' & [TextBox] & '*'`) and that you have added `Me.ListBox.Requery` to the text box's On Change event.

Can I use the LIKE operator on numeric fields in Access?

It is not recommended. The LIKE operator is designed specifically for string (text) comparisons. For numeric fields, you should use standard comparison operators like `=`, `>`, `<`, or `Between`.

How do I use the text box `.Text` property in VBA filtering?

If you trigger the filter on the 'On Change' event of the text box, the `.Value` property has not updated yet. You must use `Me.TextBoxName.Text` in your VBA code to capture the keystrokes as they happen.

Why is my database slow when filtering a list box?

Using a leading wildcard (e.g., `Like '*text*'`) prevents Access from using database indexes on that field. If performance is slow on a large dataset, remove the first asterisk to perform a prefix search (`Like 'text*'`), which allows Access to utilize indexes.