Making a mail merge from a query

G

Guest

I need to make a mail merge from a query. The query is needs to be passed two
dates that funciton as a date range for the query to pull records, and then
dump those records into a mail merge. I would like for the user to be able to
push a button, enter the two dates, and have the mail merge printed out. I am
currently just having the user edit the query in design mode manually, saving
it, and the mail merging the query. I just want it to be more user friendly.

Any ideas?
 
G

Guest

Hi William

There are a number of processes you will need to "set up" before your mail
merge will perform as you want.
1 Make a query that will supply the base for the merge (which I think you
already have)
2 Make a form with your button on it to start the merge (again which I think
you have already)
3 The mail merge itself. There are a number of ways to do this. The
simplest being a "report" that prints OnClick to all the filtered record in
your query. You can also open Word and use this to send the 'letters'. etc
etc

So

1 Create the query
Open your query in design view and in the Start Date column (in the criteria
row) put this [Please enter start date]
Do the same in the column containing the End Dates [Please enter end date]
Save the query

2 If it is a standard 'letter' then you should simply create a report based
on the query. Or if you want to mail merge with MS Word you could use the
process shown here (which does look a little complicated at 1st but it is
quite simple to use if you follow Albert's instructions - read them 1st)
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html
You can still use the query to feed the merge but (I think - may be wrong on
this) Albert's merge works on a single merge (normally from a form) so not
sure if you could use it for multiple recipients.



3 If you have used a standard report (and created the report)
Open you form in design view
Place a button somewhere on the form.
Open the properties box on the button and in the Event column select the
OnClick row.
Click the build option (...) and select Code
You will see this

Private Sub ButtonName_Click()

End Sub

You need to insert a line of code between these lines like this

Private Sub ButtonName_Click()
DoCmd.OpenReport "ReportName", acViewNormal, "", "", acNormal
Private Sub ButtonName_Click()

In the above code change the
ButtonName and ReportName to what they really are.

View the form in normal view and press the button and you will be asked for
the start and end dates after which the report will print.

Hope this helps
 
G

Guest

Wayne-
Thanks so much for your help. The thing from Albert worked awesome. Now it
is to send a mail merge of a single record. I also need, however, to be able
to do a mail merge from a certian amount of records defined by a query. I
couldn't firgure out how to pass a query to albert's program to only merge
certian records.

Any other ways to do this?

Much thanks in Christ,
William


Wayne-I-M said:
Hi William

There are a number of processes you will need to "set up" before your mail
merge will perform as you want.
1 Make a query that will supply the base for the merge (which I think you
already have)
2 Make a form with your button on it to start the merge (again which I think
you have already)
3 The mail merge itself. There are a number of ways to do this. The
simplest being a "report" that prints OnClick to all the filtered record in
your query. You can also open Word and use this to send the 'letters'. etc
etc

So

1 Create the query
Open your query in design view and in the Start Date column (in the criteria
row) put this [Please enter start date]
Do the same in the column containing the End Dates [Please enter end date]
Save the query

2 If it is a standard 'letter' then you should simply create a report based
on the query. Or if you want to mail merge with MS Word you could use the
process shown here (which does look a little complicated at 1st but it is
quite simple to use if you follow Albert's instructions - read them 1st)
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html
You can still use the query to feed the merge but (I think - may be wrong on
this) Albert's merge works on a single merge (normally from a form) so not
sure if you could use it for multiple recipients.



3 If you have used a standard report (and created the report)
Open you form in design view
Place a button somewhere on the form.
Open the properties box on the button and in the Event column select the
OnClick row.
Click the build option (...) and select Code
You will see this

Private Sub ButtonName_Click()

End Sub

You need to insert a line of code between these lines like this

Private Sub ButtonName_Click()
DoCmd.OpenReport "ReportName", acViewNormal, "", "", acNormal
Private Sub ButtonName_Click()

In the above code change the
ButtonName and ReportName to what they really are.

View the form in normal view and press the button and you will be asked for
the start and end dates after which the report will print.

Hope this helps

--
Wayne
Manchester, England.



William5271 said:
I need to make a mail merge from a query. The query is needs to be passed two
dates that funciton as a date range for the query to pull records, and then
dump those records into a mail merge. I would like for the user to be able to
push a button, enter the two dates, and have the mail merge printed out. I am
currently just having the user edit the query in design mode manually, saving
it, and the mail merging the query. I just want it to be more user friendly.

Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top