Re: Printing first and last record on each page (Access 2K/SR1)

I had tried that code from the Solutions database as well but exact same thing that happened to John happened to me...When I entered all that code...nothing happened. I run Access 2000 just like John. From Charlotte, it sounds like I need to modify my code using slightly different code. I'll try that and get back to you if I don't get it to work.

Re: Printing first and last record on each page (Access 2K/SR1)

Brent,

I've used the code and even elaborated on it, but I also know that it can go belly up at times. I've had reports stop working and the only thing I could do was copy and paste everything to a new report, which then proceeded to work properly! <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

' Array for last record on each page and last record in recordset.
Dim gLast() As String

' Flag for number of passes through report.
Dim gLastPage As Integer

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
' During second pass, fill in FirstEntry
' and LastEntry text boxes.
If gLastPage = True Then
Reports!Report1!FirstEntry = Reports!Report1!Name
Reports!Report1!LastEntry = gLast(Reports!Report1.Page)
End If

End Sub

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)
' During first pass, increase size of array
' and enter last record on page into array.
If Not gLastPage Then
ReDim Preserve gLast(Reports!Report1.Page + 1)
gLast(Reports!Report1.Page) = Reports!Report1!Name
End If