Access merge with Word

W

Wissam

I am new to access and trying to create database for my patients. I have an
access 2000 database that I created using access 2003. In this, there is a
table called PATIENTS that contains fields for basic information about
patients (ID, name, age,...). The database has another table called VISITS
that contains visit lab results for these patients (field examples are ID,
visitdate, cholesterol, glucose,..). A one-to-many relationship exists
between PATIENTS and VISITS based on ID. I created a form called RECORDS that
gets data to Table PATIENTS and has subform that gets data to Table VISITS. I
want to add a command button OpenWord on the form RECORDS that when clicked
would automatically open a word document file called Merged, collect the data
about the patient with the specified ID value on the form, and send that to
the word file with the following format:
*******************************************
Mr. <name e.g. Smith> is an <age e.g. 32) year-old patient who is here for
follow up.
Current and previous lab results as follows:
Date Cholesterol Glucose <below data to be pulled from subform>
1/1/2000 180 95
1/1/2006 220 102
**********************************
Based on examples on this website I was able to do the following steps:
Create the OpenWord command button and have it open the saved word file named
Merged.doc. However, I do not know how to adjust the code so that it would
fill the above record format. Any help in this matter is highly appreciated.
Thanks
 
J

Jeanette Cunningham

Hi Wissam,
on Albert Kallal's website there is an excellent sample database that does
merges with Word, it is easy to use.
Just google on the name Albert Kallal, look for his page on ms access.

Jeanette Cunnningham
 
W

Wissam

Dear Jeanette and Mr. B,
Thanks for your help. Based on your precious tips, I was able to get a
command button on the form to open a saved blank word document. However, I am
having problems building up the access code that is needed to fill this
document from the access form. Specifically, the access form is linked to a
table called PATIENTS that has records of patients (a patient has single
record; fields are ID, name, age,..) and a subform that links to another
table called VISITS (its records are visit lab results for patients; a
patient could have more than one visit record; fields included are ID,
VisitDate, Cholesterol, glucose,..). I want to build a command button that
opens the word document, and pulls data for the patient with the specified ID
on the form to the word document (example name, age) and then pulls data for
the visits of that same patient and put it in a table format in the word
document, with columns like VisitDate, Cholesterol,...
therefore, the structure of the word template would be:
<name > is a <age> year-old patient who is here for follow up.
Results table:
Date Cholesterol Glucose {'and data in table would be filled
from access database to something like.}
12/2/2007 160 80
I would be very grateful for tips on such a code.
Thanks a lot for your help.
*****************************************************
 

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