Mail merge from a form?

  • Thread starter Thread starter Jan
  • Start date Start date
J

Jan

Hi

I have a database that I am trying to develop to help run my business. It
has several tables ie Customer, Invoice, Product ect.
I have a mail merge document that generates an invoice and has a query for
its datasource. This query brings together data from the various tables. At
the moment I am manually changing the invoice number in the query each time
I need a new invoice.

What I am working on is a form that allows me to select a customer and has
the invoice table as a subform. From this form I would like to be able to
run the mail merge to print the Invoice.

What is the best way of achieving this?
The SQL is long and typically messy, so it wont be 'fun' to change that at
run time. I considered a parameter query, but research suggests that Word
will always prompt for the parameter. Its looking like a make table query
might be the best option, and using this one record table as the datasource
for the mail merge might be the easiest to implement. Would that be a good
way to go?

I using Office XP.

Thanks
J
 
Hi,

I suggest that you build the report in access itself.
It's faster and you have direct control on what you are going to print.
Also Reports in access are fairly easy to create and very flexible.

e.g. DoCmd.OpenReport "YourReport",acViewPreview
,WhereCondition:="Invoice_ID=" & SubForm.Form.Invoice_ID
 
Hi

That does seem more sensible. Can I just ask what I should use as the data
source for the report? IS that a parameter query with the whereCondition
passing the values?

Thank you for your help
J
 
No,

You just build a query which contains the data you want to show on that
report.
By using the grouping feature in the report you can split the header data
from the detail data (in case of multiple lines)
Make sure that this query contains the field for which you will set the
condition when you open the report as in my example Invoice_ID so Invoice_ID
should be in this query.
 
Back
Top