Hide the Page Header on the Last Page of an Access Report
Question details
Suppress the standard page header only on the final page of an Access report.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A report ends with a summary page that should not show the page header used on earlier pages.
- Observed behavior
- The page header properties do not offer an option to hide the header only on the final page.
Open the report in Design View and confirm that it has a Page Header section. The database must allow VBA code to run; enable content only if you trust its source.
Cancel the page header on the final report page
Use the Page Header section's Format event to compare the current page number with the report's total page count.
In the Navigation Pane, right-click the report and select Design View.
Select the Page Header section, open the Property Sheet, and choose the Event tab. In the On Format property, select Event Procedure, then click the build button.
In the generated Format event procedure, enter `Cancel = (Page = Pages)` between the procedure's opening line and `End Sub`. Save the code and report.
Open the report in Print Preview and check that the header appears on earlier pages but not on the final page.

Create and Format Documents with WPS Office
WPS Office is a free, lightweight alternative with familiar editing tools and Microsoft Office format compatibility for an easier move between office suites. It does not replace Microsoft Access or run Access report events.

Frequently Asked Questions
Why doesn't the header disappear in Report View?
The section's Format event does not run in Report View. Open the report in Print Preview to test the event.
What happens if the report has only one page?
That page is also the final page, so `Cancel = (Page = Pages)` suppresses its page header.
How can I make the total page count available to the report?
Add a visible text box to the report footer with a Control Source that references `[Pages]`, such as `="Page " & [Page] & " of " & [Pages]`, and test the report in Print Preview.
Does this code hide the entire last page?
No. When placed in the Page Header section's Format event, the statement cancels that section on the final page; it does not cancel the entire page.




