logo
search
Others

How to Display the Correct Total Page Count in an Access Report

John WilsonJohn Wilson Oct 13, 2026 869 views

Question details

The user needs to accurately display the total page count on the first page of a Microsoft Access report, which currently shows "Page 1 of 1" incorrectly due to expanding text boxes.

How to Display the Correct Total Page Count in an Access Report
Product
Microsoft Access
Device & OS
not provided
Scenario
Printing or viewing a multi-page Access report where text boxes dynamically expand, pushing content to subsequent pages.
Observed behavior
The first page incorrectly displays "Page 1 of 1" because Access renders the first page before the final page count is fully calculated.
Before you start

Ensure you have design view privileges for the Microsoft Access database and identify the specific report where the page footer needs modification.

Solution 1Recommended

Implement two-pass report pagination

When expandable text boxes cause content to spill over dynamically, running the report twice ensures the accurate total page count is calculated before the final display.

Microsoft Access typically renders page 1 before the second page is fully processed. If your report contains expandable text boxes, the initial render assumes a single page.

A two-pass technique forces Access to calculate the total pages first, store the result, and then apply it to the final render. This requires opening the report in hidden mode first.

1
Create a calling form

Create a form with a command button that users will click to open the report, rather than opening the report directly from the navigation pane.

2
Write the VBA macro for the first pass

In the button's On Click event, write VBA code to open the report in hidden mode (acViewPreview, WindowMode:=acHidden) to force Access to calculate the total pages.

3
Store the total page count

Retrieve the [Pages] property from the hidden report and store it in a public variable or a hidden text box on your calling form.

4
Reopen the report for the second pass

Close the hidden report using VBA, and then immediately reopen it in normal view. Modify your report's footer to read the stored variable instead of the default [Pages] property.

Implement two-pass report pagination
Advanced Technique: This method requires basic knowledge of VBA (Visual Basic for Applications) in Microsoft Access. Ensure you test the macro in a backup copy of your database first.
Free Microsoft Office alternative

Need a lightweight alternative for your daily office tasks?

While Microsoft Access handles complex databases, you can rely on WPS Office for all your documents, spreadsheets, and presentations. WPS Office is a free, highly compatible alternative to Microsoft Word, Excel, and PowerPoint, featuring a familiar interface that makes switching effortless.

  1. 1. Download the installer: Visit the official WPS Office website and click the free download button for your operating system.
  2. 2. Install the software: Run the lightweight installation file and follow the simple on-screen instructions.
  3. 3. Open your files: Launch WPS Office and instantly open your existing Word, Excel, or PowerPoint documents without losing any formatting.
Fully compatible with Microsoft Office formats (.docx, .xlsx, .pptx).Create professional reports and data summaries seamlessly in WPS Spreadsheet.Lightweight installation that runs smoothly on most operating systems.Familiar ribbon interface requiring zero learning curve.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Access report say "Page 1 of 1" when there are multiple pages?

This happens because Access renders the first page before the rest of the report is fully processed. If text boxes expand and push content to a new page dynamically, the initial calculation is already printed as "Page 1 of 1".

Can I fix the page count without using VBA?

Yes, simply adding the [Pages] parameter to your Control Source expression (e.g., ="Page " & [Page] & " of " & [Pages]) forces Access to evaluate the total pages for standard reports. However, highly dynamic reports with expandable text boxes might still require a two-pass VBA macro.

What does the [Pages] variable do in MS Access?

The [Pages] variable is a built-in property in Microsoft Access that calculates and stores the total number of pages in the active report, whereas [Page] stores the current page number.

How do I access the Page Footer in my report?

Open your report in Design View, right-click any blank area on the canvas, and ensure "Page Header/Footer" is checked. You can then insert a text box directly into the Page Footer section.