[AccessD] Last page of Report

A.D.Tejpal adtp at touchtelindia.net
Mon Sep 5 07:04:56 CDT 2005


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