Mail Merge a single record from a Form (1 Viewer)

LanHua

Registered User
Joined
Feb 19, 2016
Messages
15
Good afternoon,
I am hoping someone can help - or at least point me in the right direction.
I have created a database for CRM purposes and need to mail merge from the database.
I have created a form frmQuoteDetails based on a query qryPeopleQuotes that shows one record at a time. I have created a command button Mail Merge Quote and added macros behind the button that
1) Open the query the form is based on (OpenQuery)
2) Runs the mail merge (RunMenuCommand)
3) Closes the query

This all works fine but mail merges all 400 odd quotes that we have in the system. What I need it to do is only merge the one record that is being viewed on the form. I have tried ApplyFilter and GoToRecord macros but they are not working.

Any suggestions on where I am going wrong?

Thanks
 

pbaldy

Wino Moderator
Staff member
Joined
Aug 30, 2003
Messages
33,638
For starters, you probably don't need steps 1 and 3. Does 2 run a merge to Word, or open a report? You can easily filter a report using this:

http://www.baldyweb.com/wherecondition.htm

If it's a Word mail merge, I haven't done one from Access. Perhaps you can base it on a separate query that refers to the form for a criteria, thus returning only that record.
 

LanHua

Registered User
Joined
Feb 19, 2016
Messages
15
Thanks for your reply. Yes it merges to word, but I found that if I didn't do step 1 then the RunMenuCommand doesn't work.
I will see if creating a separate query fixes the problem.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom