By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,776 Members | 1,302 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,776 IT Pros & Developers. It's quick & easy.

Open MS Word and Insert Data

P: 2
I am helping a friend with an Access DB and I am having trouble with this:
I have 2 drop down boxes in a form. In one, the user will select the customer name from a table, and the other the specific MS Word document to be opened.
What I am trying to accomplish is to open the Word document and once is opened, it automaticly inserts the customer name, address and other information from the respective table.
Please help!
Thanks
Aug 26 '06 #1
Share this Question
Share on Google+
3 Replies


PEB
Expert 100+
P: 1,418
PEB
Hi
U can do it by:

1. When you create the documents in MS Word, you have to use the Tools/Letters and mailings/ Mail Merge. This 'll create a document type that will get the information from your MS Access Query with the information about your customers

2. In Access you create a query that contains the info about your customer that is choosen from the list

3. U use the shell(Path, type of opening) to start MS Word and the specified Document

4. In word u click on Merge the document and it's ready!
Aug 29 '06 #2

P: 2
Hi
U can do it by:

1. When you create the documents in MS Word, you have to use the Tools/Letters and mailings/ Mail Merge. This 'll create a document type that will get the information from your MS Access Query with the information about your customers

2. In Access you create a query that contains the info about your customer that is choosen from the list

3. U use the shell(Path, type of opening) to start MS Word and the specified Document

4. In word u click on Merge the document and it's ready!
Thanks for the answer, but wouldn't this create a mail merge with all the clients in the query? I just want one particular client on the document I am going to print.
Jorge
Aug 31 '06 #3

PEB
Expert 100+
P: 1,418
PEB
Just this will create a merge with all info in the query! So to have the specified client you can use the follow code for creating an appropriate query:

Set mydb = CurrentDb()
Set Myquery = mydb.CreateQueryDef(names, SQLS)

SQLS is your query SQL where you specify the customer ID that you would like to appear!

Before Save the new SQL you should delete the ancient query!

So you have to insert those statements in On click event in the lists!
Sep 1 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.