Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mailmerge - total records?

Status
Not open for further replies.

GaryRW

Programmer
Mar 8, 2002
67
0
0
GB
I can't believe I can't work this one out (feeling it's very obvious)

Is there a way to tell how many records there are in your data source in a mail merge? I want the equivalent of a { NumRec } field!

any help would be much appreciated.
 
Look up the Dcount function in Acccess Help. Assuming your record source is a table or query you should be able to use it to find the number of records. Maq [americanflag]
<insert witty signature here>
 
Sorry, should've given more info...

What I'm trying to do is to control the mail merge.

I'm using the NEXT mergefield to show more than one record on a page, but I want to do a NEXTIF and only move onto the next record if the last record hasn't already been reached.

As it is, I am just using NEXT but I am dealing with small (varying) numbers of records. There are some fields that share the same data with all the other records, and then some fields with unique data for each record.

Essentially, there is a section in the middle of the merge doc that I need to show the unique data for each record, followed by a section at the bottom that shows the shared data. But the NEXT fields above that seem to move past the last record, and then all the shared fields come up as blank.

Any ideas?

As always, any help is much appreciated
 
Well, it's starting to sound like you're coding in MS-Word, not Access. Have you tried posting the question in one of the Word forums? They may be able to help more than I could.

Perhaps you can use recordset.EOF to check for EOF before moving on to the next record. Maq [americanflag]
<insert witty signature here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top