Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / May 2004

Tip: Looking for answers? Try searching our database.

Listing multiple records in a single document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
EHPorter - 26 May 2004 15:57 GMT
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.
Greg - 26 May 2004 16:22 GMT
EH,

I think you could use the "Catalog" option when you create
your merge main document to do this.
>-----Original Message-----
>I frequently create documents by merging to an access database.  After doing
[quoted text clipped - 28 lines]
>
>.
Chuck Hartman - 26 May 2004 18:40 GMT
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

> 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
[quoted text clipped - 25 lines]
>
> Thanks in advance.
Doug Robbins - Word MVP - 27 May 2004 09:18 GMT
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.
Signature

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

> 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
[quoted text clipped - 25 lines]
>
> Thanks in advance.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.