Fix MS Access LIKE Queries Not Working with Percent Wildcards
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.

- 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.
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).
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.
Open your Access database and find the DoCmd.OpenForm VBA code or the stored SQL query that is failing to return records.
Change the percent sign (%) in your LIKE string to an asterisk (*). For example, modify "tblCaseInfo.Facility LIKE '%Xe%'" to "tblCaseInfo.Facility LIKE '*Xe*'".
Ensure that your text values are enclosed in single quotes within the double-quoted filter string so the SQL interpreter reads them correctly.
Run the query or execute the VBA command again to confirm that the form opens and displays the correctly filtered records.

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. Download the software: Visit the official WPS website and download the free installation package for your operating system.
- 2. Install WPS Office: Run the installer and follow the quick on-screen instructions to set up the software.
- 3. Open Office formats: Double-click any Word, Excel, or PowerPoint document to open it directly in WPS Office with formatting fully preserved.

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.




