Merge Template in Word and using a "Where" Statement

S

Sander

Hi All,

I am having a database with customers and now i am
creating word merge template's which I would like to use
with the database. The templates use a query to get their
information.
So far everything is working great. E.g. The merge will
process the entire database. So I get 10 word page's with
customers.

Now i would like to use the "Where" statement in my merge
template. The reason for this is that i want a letter from
one specific customer.
So it should say something like this.
Where Customer.ID = [Enter customer ID:] and Customer.date
= [Enter the date of the event to use in the letter:]

If I do this in my Query I can't use the query anymore to
merge.

Does anyone know how to do this.
Help would be very appreciated.
I have Word and Access 2002

Kind regards

Sander.
 
C

Cindy M -WordMVP-

Hi Sander,

Well, you basically have two choices

1. You can change to using a DDE connection to the Access
data source so that the user can answer a parameter query in
the Access interface.

2. You can display a UserForm when a new document is
generated from the template for the user to type the
information. The macro can then set the .QueryString property
for the mailmerge.datasource

which approach to use will depend on how you want the users
to interface, what your programming background is, and
whether the template project may even have macros...
I am having a database with customers and now i am
creating word merge template's which I would like to use
with the database. The templates use a query to get their
information.
So far everything is working great. E.g. The merge will
process the entire database. So I get 10 word page's with
customers.

Now i would like to use the "Where" statement in my merge
template. The reason for this is that i want a letter from
one specific customer.
So it should say something like this.
Where Customer.ID = [Enter customer ID:] and Customer.date
= [Enter the date of the event to use in the letter:]

If I do this in my Query I can't use the query anymore to
merge.

Does anyone know how to do this.
Help would be very appreciated.
I have Word and Access 2002

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 
S

Sander

Hi Cindy,

my programming background is VB6.0 just from the books. So
I am not a Expert yet.

They are allowed to do macro's. I think that with the DDE
connection is the easiest way for me. But where do I setup
the DDE connection then. Is it in Word of my Access
database?
And if you have maybe a example or more tricks to do this
I would be very happy.

Kind regards

Sander.
-----Original Message-----
Hi Sander,

Well, you basically have two choices

1. You can change to using a DDE connection to the Access
data source so that the user can answer a parameter query in
the Access interface.

2. You can display a UserForm when a new document is
generated from the template for the user to type the
information. The macro can then set the .QueryString property
for the mailmerge.datasource

which approach to use will depend on how you want the users
to interface, what your programming background is, and
whether the template project may even have macros...
I am having a database with customers and now i am
creating word merge template's which I would like to use
with the database. The templates use a query to get their
information.
So far everything is working great. E.g. The merge will
process the entire database. So I get 10 word page's with
customers.

Now i would like to use the "Where" statement in my merge
template. The reason for this is that i want a letter from
one specific customer.
So it should say something like this.
Where Customer.ID = [Enter customer ID:] and Customer.date
= [Enter the date of the event to use in the letter:]

If I do this in my Query I can't use the query anymore to
merge.

Does anyone know how to do this.
Help would be very appreciated.
I have Word and Access 2002

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)

.
 
C

Cindy M -WordMVP-

Hi Sander,
They are allowed to do macro's. I think that with the DDE
connection is the easiest way for me. But where do I setup
the DDE connection then. Is it in Word of my Access
database?
Assuming these templates already have the connection to the
required query, you wouldn't need any additional programming
code. You can set up the connection in the template, and
everything will be hunky-dory (probably).

Activate "Confirm conversions on open" in
Tools/Options/General, then attach to the Access database
again. From this point on, you'll see a slightly different
series of dialog boxes...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 

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