Help with Access -> Word Mail Merge (1 Viewer)

yahazim

Registered User.
Local time
Today, 01:03
Joined
Apr 2, 2001
Messages
24
Hello!

I am doing my best to develop a database that automates the generation of a series of Test Cases using the Mail Merge feature of Microsoft Word to import information from an Access Database.

I can get all the fields to fill out correctly from EXCEPT for the fields that are Many to One.

For example, each Test Case has a list of Test Procedures, numbered sequentially. In the Access Database this is represented by two tables, of course, to represent the Many to One relationship.

I have built a query to combine the tables into one data source for Mail Merge.

Is it possible to create a Mail Merge function that will append ALL the Procedure entries into the single Word Document?

Thank you for your prompt and intelligent replies.
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 20:03
Joined
Feb 19, 2002
Messages
43,302
I have not been able to figure out any way to do this as a mail merge. The way a mail merge works is that it creates a new document for every record in the recordsource. So that becomes a problem with a 1-many recordsource since you want to include some number of records in a single document.

I have been able to do this quite successfully via automation from Access. I had a number of complex specification documents to produce for a manufacturing company. Each part type was different enough from the others to warrent its own template. So I created 8 templates each with bookmarks for the pieces of data that I wanted to populate from Access. Each template had a number of single instance items from the 1-side record and also from 8 to 12 related many-side tables that needed to be included as sections. The easiest method for creating the various many-side sections was to define a bookmark for each and then in VBA create a table to insert at the bookmark.

It is way too much code to include so I've created a stripped down Word file that contains the main module which creates the document and fills in the 1-side data fields, one table creation function, and the formatting function for the table. The whole process is controlled by tables so the sections that each document can contain are represented as functions and the function names are stored in a table. The eval() function is used to enable the code to "call" the appropriate function. The functions each contain the name of the specific bookmark where their data should be inserted.
 

Attachments

  • createword.zip
    7.6 KB · Views: 355

Users who are viewing this thread

Top Bottom