2 entries from DB in one document

S

stephan82

I am trying to create envelopes with sender and recipient. Th
information for both is in the same DB and the same table.

Is there a way to get to different records in one document?

Maybe some Macro/VBA
 
P

Peter Jamieson

Depending on exactly what you are trying to do, you may be able to...
a. organise that your data source is a query or view that does the
necessary SQL Join to bring both address fields into the result. That's if
you're mailmerging.
b. use one of more DATABASE fields in your document to get the different
records you need. In essence you use Tools|Customize to enable the database
toolbar, then use the Insert Database button to get the data, inserting it
as a field. If you only have one column and do not specify table headers,
you just get the field without a surrounding table. But you would probably
also have to modify the SQL to get all the parts of the address in a single
field.
c. use VBA and e.g. ADO to access your database and either stuff the data
directly into your document, or perhaps to set up the value of a Word
document variable that you insert via a { DOCVARIABLE } field.

In every case you really need to know how the records are related.

I doubt if that answers your question but if you need more info it would be
useful to have a bit more detail about whether you are merging or not, which
version of Word, and how you tell which specifc records the data needs to
come from.

Peter Jamieson
 

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