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

Suppress parameter prompt during mail merge

Status
Not open for further replies.
Mar 10, 2004
53
US
I've created a command button on a form that calls a word document to do a mail merge. It runs a query and uses the value of an ID field in the form as the query parameter.

When the mail merge runs, the normal parameter window pops up asking for input. How can I prevent this? Why is it not using the criterion value that I am using on the query?

On my query, the criteria is set to:

[Forms]![Donor tbl]![Donation Detail tbl Subform].[Form]![Donor Number]

Is there anything i can add to the statement below to have the query use the criteria above?

objDoc.MailMerge.OpenDataSource _
Name:="\\pc1\c$\donor.mdb", _
LinkToSource:=True, AddToRecentFiles:=False, _
Connection:="QUERY qryDonor Receipt", _
SQLStatement:="Select * from 'qryDonor Receipt'"

Thanks in advance.
 
My best stab in the dark: The parameter got stored as a filter value in the query. So Access asks for the Parameter value (which you provide), then it asks for the Filter value (the box you are trying to eliminate).

Hope this helps,
B.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top