Page, Pages Properties Example

The following example displays a message that tells how many pages the report contains. For this example to work, the report must include a text box for which the ControlSource property is set to the expression =Pages. To test this example, paste the following code into the Page Event for the Alphabetical List of Products form.

Dim intTotalPages As Integer, strMsg As String
intTotalPages = Me.Pages
strMsg = "This report contains " & intTotalPages & " pages."
MsgBox strMsg