Newbie question - what is the most straightforward way to...

A

AndyK

....use my VB6 application to create a series of Word documents from a template - some fixed text, and some variable text from a database? Variable data is held in about 7 different related tables; I looked at Mailmerge, but it looks to me like it only accepts a single table or query, which seems to rule this out...

If someone could point me in the right direction that would be a great help

Regard

andy
 
P

Perry

but it looks to me like it only accepts a single table or query

Look at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbawd10/htm
l/womthcreatedatasource.asp

Note specifically : SQLStatement property with which you can assign a
complex SQL statement
covering multiple (relational) tables/queries.

Krgrds,
Perry

AndyK said:
...use my VB6 application to create a series of Word documents from a
template - some fixed text, and some variable text from a database?
Variable data is held in about 7 different related tables; I looked at
Mailmerge, but it looks to me like it only accepts a single table or query,
which seems to rule this out...?
 
P

Perry

Why does it frequently happen to me that once a response
is sent, I tend to come up with other ideas ... :-((

Look at KB article: Q285332

You could also consider designing a single query in yr Access database
covering the multiple tables/queries, and have the MailMerge object
use this precompiled query as datasource.

Krgrds,
Perry
 
A

AndyK

hi Perry thanks for responding. My data structure looks like this, data from these *tables* needs including in the document:

*Invoice* covers many *Sessions*
*Invoice* has many *Adjustments*

So for example my data to include in the Word doc could be:

Invoice Total = 60.00
Invoice Date = Jan 04, 2004

Session 1 Charge = 10.00
Session 1 Date = Dec 15, 2003
Session 2 Charge = 15.00
Session 2 Date = Dec 21, 2003

Adjustment 1 Amount = 15.00
Adjustment 1 Type = Balance from previous
Adjustment 2 Amount = -8.00
Adjustment 2 Type = Payment
Adjustment 3 Amount = -10.00
Adjustment 3 Type = Payment

Forgive me my SQL skills are basic - so does the SQL statement feature allow me to get all these datasets for inclusion in the MailMerge object?

thanks again for responding!

rgrds

andy

----- Perry wrote: -----

Look at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbawd10/htm
l/womthcreatedatasource.asp

Note specifically : SQLStatement property with which you can assign a
complex SQL statement
covering multiple (relational) tables/queries.

Krgrds,
Perry

AndyK said:
...use my VB6 application to create a series of Word documents from a
template - some fixed text, and some variable text from a database?
Variable data is held in about 7 different related tables; I looked at
Mailmerge, but it looks to me like it only accepts a single table or query,
which seems to rule this out...?
 
P

Perry

As stated in one of my previous msg's, I would use
a (precompiled) query in your Access database.

In this query (say: MyQuery) y can make all sorts of joins between
the tables present in your database.
Once the query is designed and the output is according to yr wishes, you can
use this query as datasource to yr Mailmerge object in Word.

SQL statement of which wud read something like:
"select * from MyQuery"
or even
"MyQuery"

If you need assistance in designing the MS Access query,
kindly request consult in newsgroup:

microsoft.public.access.queries

Krgrds,
Perry

AndyK said:
hi Perry thanks for responding. My data structure looks like this, data
from these *tables* needs including in the document:
*Invoice* covers many *Sessions*
*Invoice* has many *Adjustments*

So for example my data to include in the Word doc could be:

Invoice Total = 60.00
Invoice Date = Jan 04, 2004

Session 1 Charge = 10.00
Session 1 Date = Dec 15, 2003
Session 2 Charge = 15.00
Session 2 Date = Dec 21, 2003

Adjustment 1 Amount = 15.00
Adjustment 1 Type = Balance from previous
Adjustment 2 Amount = -8.00
Adjustment 2 Type = Payment
Adjustment 3 Amount = -10.00
Adjustment 3 Type = Payment

Forgive me my SQL skills are basic - so does the SQL statement feature
allow me to get all these datasets for inclusion in the MailMerge object?
 

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