Others

Fix MS Access LIKE Queries Not Working with Percent Wildcards

Rana GarciaRana Garcia Nov 2, 2026 870 views

Question details

The user needs to fix an MS Access DoCmd.OpenForm filter or stored query that returns no records when using a LIKE condition.

Fix MS Access LIKE Queries Returning No Records with Percent Wildcard
Product
Microsoft Access
Device & OS
not provided
Scenario
Filtering records dynamically using a wildcard in an Access form or stored query.
Observed behavior
Using a SQL Server percent wildcard (%) in a LIKE clause causes the query to return zero records because Access interprets it as a literal character.
Before you start

Verify whether your Access database is using the default Access SQL standard (ANSI-89) or has been configured for SQL Server compatible syntax (ANSI-92).

Solution 1Recommended

Replace the Percent Sign with an Asterisk Wildcard

MS Access uses the asterisk (*) as its default wildcard instead of the standard SQL percent (%) sign.

By default, Microsoft Access uses the ANSI-89 SQL standard, which designates the asterisk (*) to represent multiple characters in a LIKE clause. If you use the percent sign (%), Access treats it as a literal character rather than a wildcard, resulting in empty query results.

You must update your VBA code or stored queries to use the correct Access wildcard syntax.

1
Locate the failing query or filter

Open your Access database and find the DoCmd.OpenForm VBA code or the stored SQL query that is failing to return records.

2
Modify the wildcard character

Change the percent sign (%) in your LIKE string to an asterisk (*). For example, modify "tblCaseInfo.Facility LIKE '%Xe%'" to "tblCaseInfo.Facility LIKE '*Xe*'".

3
Verify text quotes

Ensure that your text values are enclosed in single quotes within the double-quoted filter string so the SQL interpreter reads them correctly.

4
Test the query

Run the query or execute the VBA command again to confirm that the form opens and displays the correctly filtered records.

Replace the Percent Sign with an Asterisk Wildcard
ANSI-92 Compatibility Mode: If you are querying a linked SQL Server table via ADO or have enabled ANSI-92 compatibility in the Access database options, the percent sign (%) is actually required. The asterisk is only needed for default DAO/ANSI-89 settings.
Free Microsoft Office alternative

Looking for a Lightweight, Free Office Suite?

While Microsoft Access is a powerful database tool, your everyday document, spreadsheet, and presentation needs can be met perfectly with WPS Office. It's a lightweight, completely free alternative that handles all your standard Office files seamlessly.

  1. 1. Download the software: Visit the official WPS website and download the free installation package for your operating system.
  2. 2. Install WPS Office: Run the installer and follow the quick on-screen instructions to set up the software.
  3. 3. Open Office formats: Double-click any Word, Excel, or PowerPoint document to open it directly in WPS Office with formatting fully preserved.
Highly compatible with Microsoft Word, Excel, and PowerPoint formats.Lightweight architecture runs smoothly on Windows, Mac, Linux, and mobile devices.Familiar, intuitive user interface guarantees a zero-learning-curve transition.Includes advanced PDF editing and conversion tools built directly into the suite.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my LIKE query work in SQL Server but fail in MS Access?

SQL Server uses the ANSI-92 SQL standard where the percent sign (%) represents a multi-character wildcard. By default, MS Access uses the ANSI-89 standard, which requires an asterisk (*) instead.

Can I configure MS Access to use the percent (%) wildcard?

Yes. You can enable ANSI-92 compatibility by going to File > Options > Object Designers > Query design, and checking the box for 'This database' under 'SQL Server Compatible Syntax (ANSI 92)'. Note that this will affect all queries in your database.

What is the correct wildcard for a single character in Access SQL?

In standard Access SQL (ANSI-89), use the question mark (?) to represent a single wildcard character. If you have switched to SQL Server syntax (ANSI-92), use the underscore (_) instead.