Others

Fix Optional Wildcard Search Parameters in Microsoft Access

Rana GarciaRana Garcia Nov 20, 2026 869 views

Question details

Create an Access search query that accepts any combination of optional criteria, including partial text.

Fix Optional Wildcard Search Parameters in Microsoft Access
Product
Microsoft Access
Device & OS
not provided
Scenario
A search form needs to filter records by one, several, or all available criteria.
Observed behavior
The desired query should find text containing a term such as "hip" and ignore criteria left blank.
Before you start

Identify the table fields and search form controls you want to use. Check whether the database uses ANSI-89 wildcards, such as *, or ANSI-92 wildcards, such as %.

Solution 1Recommended

Use a separate optional condition for each Access query parameter

Use this approach when users need to combine partial text and exact-match filters or leave any filter blank.

1
Open the query in SQL View

In Access, open the search query in Design View, then select View > SQL View. Replace the table and field names in the following example with your own.

2
Add the optional criteria

Use a WHERE clause such as: SELECT * FROM [YourTable] WHERE ([TextField] LIKE "*" & [Search text] & "*" OR [Search text] IS NULL) AND ([StatusField] = [Status] OR [Status] IS NULL);

3
Connect the form controls

To use an open search form instead of parameter prompts, replace each occurrence of a parameter with its control reference, such as [Forms]![SearchForm]![SearchText]. Use the same reference in both parts of that condition.

4
Test the search

Run the query from the open form or select Run in Query Design. Test "hip", an exact status, both criteria together, and blank criteria. Confirm that an empty control supplies Null.

Use a separate optional condition for each Access query parameter
Wildcard and performance considerations: The * wildcard shown is for ANSI-89 mode; use % in ANSI-92 mode. A leading wildcard can make searches slow and can match unintended text.
Free Microsoft Office alternative

Work with exported Access data in WPS Office

WPS Office is a free, lightweight alternative for working with Office documents. Export Access data to an Excel workbook and open it in the familiar WPS Spreadsheets interface for a straightforward move to spreadsheet-based work. WPS does not run Access queries or fix Access forms.

Open exported Access data in WPS Spreadsheets for spreadsheet-based review.Compatible with Microsoft Excel XLSX and XLS files.Use a familiar interface for working with Office files.Free and lightweight for everyday document and spreadsheet work.
microsoft office alternative - wps office

Frequently Asked Questions

Why does each optional condition need parentheses?

Parentheses keep each match test together with its IS NULL alternative. Join the parenthesized conditions with AND so each criterion is evaluated independently.

How do I find records containing the word "hip"?

In an ANSI-89 Access query, use a condition such as [TextField] LIKE "*" & [Search text] & "*" and enter hip for the parameter. This also matches longer text containing those letters.

Why does Access still prompt for a parameter when I use a form?

Check the spelling of the reference in SQL View, including the form and control names, and make sure the form is open. A reference such as [Forms]![SearchForm]![SearchText] must match the actual names.

Can I leave just one date limit blank?

Yes. Test the start and end parameters independently with IS NULL conditions. This allows either limit to be omitted without relying on BETWEEN.

What happens when every search criterion is blank?

If every optional control supplies Null, each IS NULL alternative is true, so the query returns all records unless another condition restricts them.