This article applies only to a Microsoft Access database (.mdb).
For example, Like "B*" will not work correctly, but Like "B%" will work correctly.
- Change the criteria from "*" to "%" or from "?" to "_".
Note If the query is being used by Access, make a copy of the query, change to "%" or "_" in the copy, and then use this copy for merging with Word.
- Modify the database to use ANSI 92 syntax. In Microsoft Office Access 2003 or earlier versions of Access, do this by clicking Options on the Tools menu. Then, click the Tables/Queries tab. On this tab, click to select the SQL Server Compatible Syntax (ANSI 92) check box, and then modify all queries to use "%" instead of "*" or "_" instead of "?".
In Microsoft Office Access 2007, click the Microsoft Office Button, click the
Object Designers tab, click to selct the This databasecheck box under SQL Server Compatible Syntax (ANSI 92), and then modify all queries to use "%" instead of "*" or "_" instead of "?".
Steps to Reproduce the Behavior
- In Access 2003 or in an earlier version of Access, open the sample database Northwind.mdb.
- Create a new query that is based on the Customers table.
- In the Criteria row, under the Company Name field, add Like "A*".
- Save and then close the query.
- In the Database window, click the query that you just created.
- On the Tools menu, point to Office Links, and then click Merge It with Microsoft Word.
- On the first page of the Microsoft Word Mail Merge Wizard, click Create a new document and then link the data to it, and then click OK. Note that Microsoft Word opens.
- On the Mail Merge toolbar, click Insert Merge Fields. Select the field or fields to insert into the mail merge document, and then click Close.
- On the Mail Merge toolbar, click Merge to New Document, and then click OK. Note that you receive the error message that is mentioned in the "Symptoms" section of this article.