Record count for merge records

D

Doug Banwell

I am doing Word mail merges from subsets of Access data and their sub-
records.
I merge multiple sub-records into a single document, but ....
I need to know the number of records in my current merge. (So I can
construct a table of the correct length).
Currently, I ask the user to enter the number of sub-records involved,
but I need to make it automatic.
I have had no luck with
ActiveDocument.MailMerge.DataSource.RecordCount because it returns the
number of records in my entire database table instead of the number of
records selected in the current merge.

Any suggestions or helpful hints would be greatly appreciated.

Thx,
Doug Banwell
 
P

Peter Jamieson

It's pretty hard to get the count if you take into account everything the
user can do - e.g. if they make individual selections in the Mail Merge
Recipients dialog.

I think I would try to use Word's Mail Merge Events to generate table rows
on a record-by-record basis or possibly - if you can give the user a
suitable button - to do a complete "dummy run" and count the number of
records (perhaps you can then throw away the output document) before doing
the real merge.
 
D

Doug Robbins - Word MVP

I would probably do the whole thing in Access. Alternatively, a
"roll-your-own" vba equivalent to mail merge.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
L

Lara

Would it be feasable to use a query - in Access on the table/query you are
running the merge from - which is grouped and uses the Count function? Then
you know how many records are going out even before you start the Mail
merge.... Lara
 

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