You can use the Page and Pages properties to return information needed to print page numbers in a form or report. For example, you could use these properties to print "Page n of nn" in the page footer of a report.
Setting
Although you can set the Page property to an Integer value, you most often use these properties to return information about page numbers. Both properties return an Integer value when used in an expression.
You can use the Page and Pages properties in an expression, a macro, or Visual Basic.
These properties are only available in Print Preview or when printing.
The Pages property is read-only at all times.
Remarks
To refer to the Pages property in a macro or Visual Basic, the form or report must include a text box whose ControlSource property is set to an expression that uses Pages. For example, you can use the following expressions as the ControlSource property setting for a text box in a page footer.
This expression | Prints |
---|---|
=Page | A page number (for example, 1, 2, 3) in the page footer. |
="Page " & Page & " of " & Pages | "Page n of nn" (for example, Page 1 of 5, Page 2 of 5) in the page footer. |
=Pages | The total number pages in the form or report (for example, 5). |