Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 05-13-2016, 07:40 AM   #1
LanHua
Newly Registered User
 
Join Date: Feb 2016
Location: Scotland, UK
Posts: 15
Thanks: 5
Thanked 0 Times in 0 Posts
LanHua is on a distinguished road
Mail Merge a single record from a Form

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

LanHua is offline   Reply With Quote
Old 05-13-2016, 08:57 AM   #2
pbaldy
Wino Moderator
 
pbaldy's Avatar
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 32,602
Thanks: 10
Thanked 3,972 Times in 3,910 Posts
pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold
Re: Mail Merge a single record from a Form

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.
__________________
Paul
Microsoft Access MVP

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
pbaldy is offline   Reply With Quote
The Following User Says Thank You to pbaldy For This Useful Post:
LanHua (05-16-2016)
Old 05-15-2016, 11:17 PM   #3
LanHua
Newly Registered User
 
Join Date: Feb 2016
Location: Scotland, UK
Posts: 15
Thanks: 5
Thanked 0 Times in 0 Posts
LanHua is on a distinguished road
Re: Mail Merge a single record from a Form

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.

LanHua is offline   Reply With Quote
Old 05-16-2016, 05:01 AM   #4
LanHua
Newly Registered User
 
Join Date: Feb 2016
Location: Scotland, UK
Posts: 15
Thanks: 5
Thanked 0 Times in 0 Posts
LanHua is on a distinguished road
Re: Mail Merge a single record from a Form

The separate query seems to have done the trick - thank you.
LanHua is offline   Reply With Quote
Old 05-16-2016, 05:45 AM   #5
pbaldy
Wino Moderator
 
pbaldy's Avatar
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 32,602
Thanks: 10
Thanked 3,972 Times in 3,910 Posts
pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold
Re: Mail Merge a single record from a Form

No problem, glad it worked for you.

__________________
Paul
Microsoft Access MVP

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
pbaldy is offline   Reply With Quote
Reply

Tags
forms , mail merge , single record

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mail merge for a single record ayh1 Modules & VBA 4 02-24-2015 03:10 AM
Command button on form - Print single record mail merge DBKate2008 Forms 1 07-26-2009 01:57 AM
Mail Merge Record Selection danny123 General 2 04-10-2007 09:25 AM
Return one record for each name for a Mail Merge pianoprodigy General 3 05-21-2003 02:10 PM
Mail Merge One Record Motorhead Modules & VBA 1 03-04-2002 06:58 PM




All times are GMT -8. The time now is 06:18 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World