Listing multiple records in a single document

E

EHPorter

I frequently create documents by merging to an access database. After doing
so, I need to produce a single report (or letter) indicating what I have
done. Thus, let us say I send letters to five selected clients. I then
what to mailmerge a single document listing those five clients

Example:

***************************************
Dear Barb:

I have just sent the flyer to the following people:

Bob
Joe
Sue
Mark
Jon
[with the 5 names above being individual records in the database]
*******************************************

Is there a simple way to do this? I've looked at some material on what are
called "compound merges," but don't believe that I need anything that
complicated. The compound merge concept apparently creates multiple
documents, each containing lists of multiple sub-records.

I just need to create a single document, containing a list extracted from
the database.

Thanks in advance.
 
G

Greg

EH,

I think you could use the "Catalog" option when you create
your merge main document to do this.
 
C

Chuck Hartman

I have used the «Next Record» merge field to use another merge data field
multiple times in a given document. The down side is that you have to have
enough «Next Record» and data fields to account for the maximum number of
records in your data source. There might be a better general solution, but
it worked fine in my limited case.

Chuck Hartman
 
D

Doug Robbins - Word MVP

Insert a bookmark in your document/template where you want the list to
appear and then use a modification of the following procedure to populate
the document with data from the database:

Dim myDataBase As Database
Dim myActiveRecord As Recordset
Dim i As Long, j As Long
'Open a database
Set myDataBase = OpenDatabase("J:\Drive D40\Access\ResidencesXP.mdb")
'Access the first record from a particular table
Set myActiveRecord = myDataBase.OpenRecordset("Owners")
myActiveRecord.MoveLast
i = myActiveRecord.RecordCount
For j = 1 To i
ActiveDocument.Bookmarks("here").Range.InsertAfter
myActiveRecord.Fields(2) & vbCr
'access the previous record
myActiveRecord.MovePrevious
Next j
'Then close the database
myActiveRecord.Close
myDataBase.Close

You will need to set a reference to the Microsoft DAO 3.6 Object Library
under Tools>References in the Visual Basic editor for this to work.
--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

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