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

How can one mail merge records on a form to a stored template?

Status
Not open for further replies.

fmasin

Technical User
May 3, 2002
163
GB
Hi,

I have created my form which I have called frmCustomer. I have also created a template which I have saved under the following path 'c;\mytemplate'.

What I would like to do is, when I browse to a particular record on my form, I should be able to click on a command button to call up my word template and insert the fields from my form to perform a mail merge, which I can either save as a document or print off to fax to the customer.

The fields on my form are txtCompanyName, txtContact, txtAddress1, txtAddress2, txtTown and txtPostcode.

Please some soul out there assist...


Thanks and regards,

Francis
 
I just posted some code in the following thread that deals with how to do just what you want: thread705-835130

First of all the Template should be setup as a MailMerge template by creating a query that will select the current record on your form. To do this make a reference in the Critiera of the query to the PrimaryKey field which should be on your form.(i.e. Record Number(autoNumber) ) The format for this is FORMS!formname!controlname.

Now while in design view select the query that I am referring to above. Click the MailMerge button and either make a new template or merge it with your already existing template. Follow the prompts. You will now be able to place the fields from the query into your template.

The code I posted shows how to open WORD from within ACCESS and make it the active window so the focus changes from ACCESS to the Word window.

Post back with any questions if you have any.

Bob Scriver
[blue]Want the best answers? See FAQ181-2886[/blue]


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top