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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail Merge date from a query

Status
Not open for further replies.

Lysander

Technical User
Jun 26, 2002
4
CA
Hi

I am trying to generate a word 2000 mail merge document in VB. The problem I am having is that my datasource is a query in Access that takes 3 parameters, I can't figure out how to pass the parameters to the query from the word.document.mailmerger.opendatasource method
without having the user prompted for them.

I assume it has something to do with the SQLstatement value
but I cant figure it out.

what I currently have is:

mydoc.MailMerge.OpenDataSource Name:=App.Path & "\firstcontacttest.mdb", _
connection:="QUERY GetHomeownerByBookcodeMonthYear", _
SQLStatement:="SELECT * FROM [GetHomeownerByBookcodeMonthYear]"

this works and I am able to generate my output document from it but I am prompted for the Parameters.


I need a way to pass the parameters from my program directly to the query


does anyone have any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top