View Full Version : Funtion for Record of Total Records


Pisteuo
04-19-2010, 07:52 AM
I have an A2007 report that includes 8 tickets per page. Each ticket represents a query record.

I would like to show which "record of total records" a specific ticket represents, much like "=[Page] & " of " & [Pages]". The page function returns 1 of 3 when there are 24 tickets on 3 pages. I need it to say 1 of 24.

Is there a function available for this? =Count(*) gets me half way there.

Thank you.

RuralGuy
04-19-2010, 12:56 PM
You can use the OnFormat event of the header to get the RecordsetClone.RecordCount after a RecordsetClone.MoveLast and then save it in a public variable for the report.

Pisteuo
04-19-2010, 06:34 PM
I tried it with RecordSet because I could not get RecordsetClone to work. RecordSet gave me essentially the same count as =Count(*) - a total count of records in the report.

Will RecordSetClone help me return a count differently than RecordSet would for records up to the OnFormat record?

Should I experiment with Bookmark?

Additionally, the underlying query is unfiltered. The report criteria comes from a VBA event.

Thanks again.

RuralGuy
04-20-2010, 05:28 AM
The RecordCount is not guaranteed accurate until you have done a .MoveLast. You can move the record pointer of the RecordsetClone without affecting the Recordset pointer. What do you mean when you say "I could not get RecordsetClone to work"? What happened?