Others

How to Conditionally Change Access Report Footer Height by Page

Ayan MasoodAyan Masood Nov 3, 2026 869 views

Question details

The user needs to set different footer heights for the first and subsequent pages of a Microsoft Access report without causing the detail section to overlap.

How to Conditionally Change Access Report Footer Height by Page
Product
Microsoft Access
Device & OS
not provided
Scenario
Writing VBA code for an Access report to dynamically increase the footer height on the first page and decrease it on subsequent pages.
Observed behavior
Changing the height in the wrong event fails, and modifying the height dynamically in the PageFooterSection_Format event causes the detail section to overlap the footer because available space is not properly recalculated.
Before you start

Before modifying your VBA code, ensure your Microsoft Access report has both a Detail section and a Page Footer section enabled, and create a backup of your database to prevent accidental data loss.

Solution 1Recommended

Format Page Footer Height Using the PageFooterSection_Format Event

Move your VBA height-adjustment code to the On Format event of the page footer and use twips to assign specific height values.

Attempting to adjust page-specific formatting in the Report_Open event will fail because the pages have not yet been generated. The correct approach is to use the PageFooterSection_Format event.

Measurements in Access VBA are calculated in twips (1,440 twips = 1 inch).

1
Access the Format Event

Open your Access report in Design View. Select the Page Footer section, open the Property Sheet, navigate to the Event tab, and click the ellipsis (...) next to 'On Format' to open the Code Builder.

2
Apply Conditional Height Logic

Insert VBA code to check the current page using 'Me.Page'. Set 'Me.PageFooterSection.Height = 2160' for a 1.5-inch footer on page 1, and 'Me.PageFooterSection.Height = 720' for a 0.5-inch footer on subsequent pages.

3
Separate Cancellation Logic

If you need to hide the footer entirely on a single-page report, keep the cancellation logic ('Cancel = True') separate from the height adjustment logic to prevent conflicts.

Format Page Footer Height Using the PageFooterSection_Format Event
Correct Event Triggering: Using the On Format event ensures the height is recalculated precisely as each individual page of the report is prepared for display or printing.
Free Microsoft Office alternative

Looking for a Lightweight Office Suite? Try WPS Office

While Microsoft Access is a specialized database tool, for your everyday documentation, spreadsheets, and presentations, WPS Office provides a highly compatible, free, and lightweight alternative to Microsoft Office. It seamlessly opens Word, Excel, and PowerPoint files without the need for a heavy subscription.

  1. 1. Download and Install: Visit the official WPS website to download the free installation package for your operating system.
  2. 2. Open Your Office Files: Launch WPS Office and directly open your existing .docx, .xlsx, or .pptx files with perfect formatting retention.
  3. 3. Edit and Save: Use the familiar ribbon interface to edit your documents and save them in standard Microsoft formats or as PDFs.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).Lightweight design that runs smoothly on Windows, Mac, and Linux systems.Familiar user interface with zero learning curve for a seamless transition.Built-in PDF editor and smart AI tools to boost your daily document productivity.
microsoft office alternative - wps office

Frequently Asked Questions

Why isn't the Report_Open event working to change footer height?

The Report_Open event fires before the report begins formatting its pages. Because the page count and layout have not been calculated yet, you cannot conditionally change page-specific heights in this event. The PageFooterSection_Format event must be used instead.

What are twips in Microsoft Access VBA?

A twip is a typographical measurement unit used in Access VBA for sizing controls and sections. There are 1,440 twips in an inch and 567 twips in a centimeter. For example, to set a section height to 1.5 inches, you assign a value of 2160.

How do I hide the page footer entirely on a single-page Access report?

Within the PageFooterSection_Format event, you can check if the total page count is exactly 1 (`Me.Pages = 1`). If true, set `Cancel = True` to cancel the formatting of the footer section, which will hide it completely for that specific report generation.