No records are displayed when you merge data with Microsoft Word (301595)
The information in this article applies to:
- Microsoft Office Access 2003
- Microsoft Access 2002
- Microsoft Word 2002
This article was previously published under Q301595 Moderate: Requires basic macro, coding, and interoperability skills.
This article applies only to a Microsoft Access database (.mdb).
SYMPTOMS
When you try to merge data from a Microsoft Access query with Microsoft Word, Microsoft Word displays one of the following error messages:
Word could not merge the main document with the data source because the data records were empty or no data records matched your query options.
No recipients match the filter criteria you specified. Check the recipient list to make sure it is not empty or change your filter criteria to include more recipients.
However, when you run the query in Microsoft Access, the correct records are displayed.
CAUSE
By default, Word is configured to use the Jet.OLEDB provider to retrieve records from an Access database. If the Access query contains the wild card characters "*" or "?" in the criteria, the wild card characters will be ignored by the Jet.OLEDB provider and no matching records will be returned. The Jet.OLEDB provider is based on ANSI 92 syntax, which supports the wild card characters "%" and "_", not the wild card characters "*" and "?".
For example, Like "B*" will not work correctly, but Like "B%"
will work correctly.
RESOLUTION
You can use the following options to allow Word to retrieve the correct records.
- 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. You can do so by clicking Options on the Tools menu, and then clicking 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 "?".
Modification Type: | Minor | Last Reviewed: | 6/8/2004 |
---|
Keywords: | kbImport kberrmsg kbmerge kbprb KB301595 |
---|
|