Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word Mail Merge 1

Status
Not open for further replies.

AT76

Technical User
Apr 14, 2005
460
US
I'm trying to create a Mail Merge for Access with Word. I've been successful so far at doing this but my issue now is that I only want one record to be displayed from the table I'm connecting to. Here's my connection string:

objWord.MailMerge.OpenDataSource Name:="C:\Documents and Settings\andres tellez\Desktop\Returns_NA.mdb", _
LinkToSource:=True, _
Connection:="TABLE T_WHSE2", _
SQLStatement:="Select TOP 1 * FROM T_WHSE2"

Can I do this? "Select TOP 1 * FROM T_WHSE2"

If so, why is it still opening more than one record in Word from table T_WHSE2?

Thanks!!!
 
Should that be:
[tt]Connection:="QUERY qryQuery", SQLStatement:="SELECT Top 1 * FROM T_WHSE2"[/tt]

Where qryQuery is the name of the relevant query?
 
I get the following error with your advise:
Error: 5922. Word was unable to open the data source.

Any thoughts?
 
I understand. I had to create a Query. Thanks Remou!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top