Controling a MailMerge...

J

John Keith

I am about to redo a procedure that will control a mail merge.

My current process requires that the AccessDB is closed. This is the
process now:
1) Data exists an access table that represents children in a household.
2) The assumption is made that the youngest child stores the most current
mailing address and parent's names. A form/sub-form process allows viewing
all children in a selected household as well as updating the address
information.
3) A button on the main menu starts the mail-merge. It runs a Make Table
query that generates the data necessary for the household. Then launches the
Word document that has the connection to the table as a datasource.

This process launches Word, but the datasource table link is not active. If
Access is closed; with the saved table data... THEN the word document is
launched, All is well and the mailmerge can proceed as normal.

Is there an alternative that will allow Word to read from an open accessDB's
table? Perhaps some kind of "Commit" changes needs to be done?

--otherwise--

I am thinking that the following changes would solve the problem and I'd
like to get some pointers from the community before diving in.

Proposed changes to the process:
1) In the command button routine, after the DoCmd.OpenQuery
"Z_MailMergeTable" statement...
Add code that will export the table to a seperate database file. Then the
execution continues and opens the Word mailmerge doc.
2) Change the Word doc to use the new database-table as the datasource.

Will there be any timing issues? (How do I make sure that the export has
finished before the code launches word)... For i = 1 to 100000000: next i <-
just seems unreliable.
 
A

Albert D. Kallal

I have a nice working sample that does a merge of the current record to
word.

The sample I have can be found here:
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html

What is nice/interesting about my sample is that is specially designed to
enable ANY form with ONE LINE of code....

Thus, each time you build a new form, you can word merge enable it with
great ease.

Make sure you read the instructions from above, and you should eventually
get to the follwoing page
http://www.members.shaw.ca/AlbertKallal/wordmerge/page2.html

Note that the merge can also use a query, and thus you don't have to merge
just "one" record..

After the merge occurs, you get a plain document WITHOUT any merge fields,
and this allows the end user to save, edit, or even email the document
(since the merge fields are gone after the merge occurs).

Give the above a try.

In your case, if you can build a query that is the one merge record of the
parent + the one child record, then you can go:

MergeAllWord "nameOfquery"

My example does not let word connect to ms-access, so the issue of not
seeing the query, or being able to connect to the table is 100%
eliminated...
 
J

John Keith

I am looking at your sample DB and I like what I see so far. I still have to
merge this with MYdb and the paragraph below concerns me...

"If you are using a network, then each user SHOULD GET their own front end.
This code assumes a split mdb. If you don't split, then users will trip over
each other with this code. For multi users, YOU MUST SPLIT THE MDB to use
this code."

Since this is my 1st real attempt at using forms, mailmerge, and a db that
will have multi-users (only 2, but still I don't want them stepping on each
other):

1) What sections(tables defs, tbl data, queries, forms, macros, modules) go
where when you split a DB?

2) Is is possible to have a front-end that when launched will pull the
necessary sections from the network? (I.E. one place to maintain
automatically-propagated-code and db elements)
 
A

Albert D. Kallal

1) What sections(tables defs, tbl data, queries, forms, macros, modules)
go
where when you split a DB?

I answer the above questions here:

http://www.members.shaw.ca/AlbertKallal/Articles/split/index.htm
2) Is is possible to have a front-end that when launched will pull the
necessary sections from the network? (I.E. one place to maintain
automatically-propagated-code and db elements)

Tony has a free updater here that pull a new version of your application
automatic here:

http://www.granite.ab.ca/access/autofe.htm
 

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