Last Detail Row

  • Thread starter Thread starter Guest
  • Start date Start date
You could Dcount the recordset in the OpOpen event (to obtain the total
number of detail records) and then keep a running counter somewhere.... When
they're equal ..... !!!!!
 
Bob,

Thank you so much for the assistance.
That worked perfectly. I had thought about it before, but I was using a
parameterized query, and I thought that I would have trouble with my
parameters, but since they had already been supplied, I just had to do a
DCount(<query column>, <query name>). BTW, I placed this in my reports
ReportHeader_Format event, since this comes after the Open event, which is
where I supply my criteria to the Query.

Again thanks so much.
It was the last item I needed for this report.
You have made my weekend!

LThibx

Bob Howard said:
You could Dcount the recordset in the OpOpen event (to obtain the total
number of detail records) and then keep a running counter somewhere.... When
they're equal ..... !!!!!
 
LThibx said:
Is there a way to determine when you are printing the last detail row for a
report?


Add a text box named txtTotalCount to the Report (or group)
header section using the expression =Count(*). This will
tell you how many records are in the report (or group).

Also, add a text box named txtLineCount to the detail
section using the expression =1 and RunningSum set to Over
All (or Over Group).

Now, you can use code in the detail section's Format event
to check if the vlues in the two text boxes are equal:

If Me.txtLineCount = Me.txtTotalCount Then
'do something special for last detail
End If
 
Back
Top