testing for eof

  • Thread starter Thread starter JimmyP
  • Start date Start date
J

JimmyP

A co-worker of mine needs to be able to test for eof in
an access report in order to print blank line on the
remaining last page. What is the best way to acomplish
this? Thank you
 
To use the following technique, you must have a control on the report that
references the Pages property, for example a text box with the Control
Source property set to =Pages. It doesn't have to be visible, but it needs
to exist on the page, because for performance reasons Access doesn't update
the Pages property unless it detects a reference to the property.

Once you've added the text box (if you don't already have one) you can use
code like this ...

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)

If Me.Page = Me.Pages Then
Me.Label6.Caption = "This IS the last page"
Else
Me.Label6.Caption = "This is NOT the last page"
End If

End Sub
 
Thanks Brendan
-----Original Message-----
To use the following technique, you must have a control on the report that
references the Pages property, for example a text box with the Control
Source property set to =Pages. It doesn't have to be visible, but it needs
to exist on the page, because for performance reasons Access doesn't update
the Pages property unless it detects a reference to the property.

Once you've added the text box (if you don't already have one) you can use
code like this ...

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)

If Me.Page = Me.Pages Then
Me.Label6.Caption = "This IS the last page"
Else
Me.Label6.Caption = "This is NOT the last page"
End If

End Sub

--
Brendan Reynolds (MVP)




.
 
Back
Top