[AccessD] Last page of Report

David Emerson newsgrps at dalyn.co.nz
Mon Sep 5 16:56:59 CDT 2005


Thanks A.D.  This worked with the additional point from Andy - "Don't 
forget to create an invisible control of = Pages or Access doesn't 
evaluate the page count."

Thanks to all that responded.

David

At 6/09/2005, you wrote:
>David,
>
>     Sample code block given below will keep track of actual page 
> count at all times, via global variable PgCount, irrespective of 
> multiple interference to [Page] value caused by resetting it repeatedly to 1.
>
>     You can test for last page by the following style of expression.
>
>         If PgCount = Me.Pages then ...
>
>     Note - Please make sure that in Event tab of report's 
> properties dialog box, [Event Procedure] appears against the events 
> used in the code below.
>
>Best wishes,
>A.D.Tejpal
>--------------
>
>==================================
>' Declare Global variable for tracking page count
>Private PgCount As Long
>
>Private Sub Report_Open(Cancel As Integer)
>     PgCount = 1
>End Sub
>
>Private Sub Report_Page()
>     PgCount = PgCount + 1
>End Sub
>==================================
>
>   ----- Original Message -----
>   From: David Emerson
>   To: accessd at databaseadvisors.com
>   Sent: Monday, September 05, 2005 09:15
>   Subject: [AccessD] Last page of Report
>
>
>   I have a report which I want to have a different text on the last
>   page.  If I can identify that the current page is the last page then
>   I am able to change the value of a text field in the footer section.
>
>   How can I tell if the current page is the last one or not?  I can't
>   use something like
>
>   If me.page = me.pages then ...
>
>   because me.page is reset back to 1 throughout the report based on 
> one of the group headers.
>--




More information about the AccessD mailing list