Microsoft

Start an Access report with a page number other than 1

Not every report will begin with the number 1. Luckily, flexible page numbering is just an expression away.

Adding page numbers to an Access report is an easy task as Access does most of the work for you. With the report in Design view, select Page Numbers from the Insert menu, click off the appropriate options, and click OK. Access will insert a text box with the appropriate expression. For instance, the following expression displays the current page number and the total number of pages: ="Page " & [Page] & " of " & [Pages] For most simple reports, you won't need anything else. However, the most common monkey wrench to the built-in feature is how to start a report with a number other than 1. The easiest solution is to bump up the internal page number by the appropriate number of pages, minus one. In other words, if you want the report to start with page 3 instead of page 1, you'd add the value 2 to the [Page] component as follows: ="Page " & [Page]+2 & " of " & [Pages] Now, the downside of that method is that the [Pages] component will still display the correct total number of pages, which may or may not be what you want. At some point, the page number will be greater than the total number of pages. You can remove the [Pages] component or add 2 to it as follows: ="Page " & [Page]+2 & " of " & [Pages] + 2 Altering the expression works fine if the first page number in the report is a fixed number. If you need more flexibility, you can use a parameter prompt into as follows: ="Page " & [Page]+([First Page Number]-1) & " of " & [Pages]+([First Page Number]-1) The [First Page Number] will display a parameter prompt and accept a value from the user. This solution allows the user to determine the starting page number for the report. Parameter prompts are susceptible to user errors, as there's no way to validate the input value. If the user enters a string or ignores the prompt altogether, the expression won't evaluate as expected. You can opt for an event procedure that validates the input value if you need more control.

About Susan Harkins

Susan Sales Harkins is an IT consultant, specializing in desktop solutions. Previously, she was editor in chief for The Cobb Group, the world's largest publisher of technical journals.

Editor's Picks

Free Newsletters, In your Inbox