View Single Post
  #2  
Old January 27th, 2010, 11:17 PM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
Default Mailmerge returns zero records

1. As far as getting the query to return records is concerned, the
chances are that you are using a filter that uses wildcards (in SQL,
something along the lines of

SELECT * FROM mytable WHERE myfield LIKE "abc*"

There are two sets of Wildcards. Access normally uses "*" for "any
character string" and "?" for a single character, but the current SQL
standards, and the OLE DB provider that Word uses to get data from
Access/Jet, require "%" for "any character string" and "_" for a single
character.

If you can edit the SQL of your query directly in Access so that it uses
% instead of * and _ instead of ?, you may find that Word suddenly
"sees" the records you expect. Hoever, it may be better to maintain two
versions of the same query becaue other software may insist on the "*"
and "?"

Another possibility (but apparently increasingly difficult in Word
2007), is to change the way Word connects to Access to DDE instead of
OLE DB. If you really want to do that, in Word 2007, check Office
button-Word options-Advanced-Confirm file format conversion on open
(near the bottom), go through the connection process again, and you
should see an additional Confirm Data Source dialog box. If you see an
entry like "MS Access databases via DDE", select it. If you only see
"OLE DB database files" (typically if you are using a .accdb rather than
a .mdb source), check Show all, then locate and select that DDE option,
and continue. In Word 2003, the option has a similar name under
Tools-Options-General.

2. As far as the constant question about connection is concerned, I
suggest you disconnect the data source from your document (set the type
of the Mail Merge Main Document to "Normal Word Document instead of
Letters,Directory, etc.) , save the document, re-open it and try again.

Peter Jamieson

http://tips.pjmsn.me.uk

On 27/01/2010 16:24, Sue Sweet wrote:
I am using Office2003 and am trying to do a mailmerge using an Access query
as my data list. I filter my query, save& close the query, open my main
document and each time it makes me open the data source and choose the query.
But then no records are returned. I can't figure out if the problem is with
Word or the Access database.

Hope someone can shed some light!!

Thanks

Sue