Force Report Footer to be at bottom of page

14,639

Solution 1

Does it have to be the report footer, or is the requirement that you wish text to appear at the bottom of the page on the last page of the report? If so, then it can be done with very little VBA:

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)
If Page = Pages Then
   Me.[TextBoxName].Visible = True
Else
   Me.[TextBoxName].Visible = False
End If
End Sub

The idea is that you place a textbox in the page footer and only make it visible on the last page.

In addition, you may wish to read http://support.microsoft.com/kb/208979/en-us

Solution 2

I found a better way here - you can have a large report footer that doesn't eat half the space on your page for the Details section

Basically you need to add the following code to your report (although you could put it in a common module):

Sub SetGrpFtrLoc(Rpt As Report, GrpFtrLoc As Double)
    GrpFtrLoc = GrpFtrLoc * 1440        'Convert from inches to twips.
    If Rpt.Top < GrpFtrLoc Then         'Not at location yet, so
        Rpt.MoveLayout = True           'move to next print location.
        Rpt.NextRecord = False          'Do not go to next record.
        Rpt.PrintSection = False        'Do not print the section.
    End If                              'Until the required offset is reached
End Sub

You can then put the following in an Event Procedure for the Report Footer's On Format.

Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
    Call SetGrpFtrLoc(Me.Report, 8)     'Display report footer at least
                                        '8 inches from the top of the page
End Sub

(MS's example made SetGrpFtrLoc a function and called it directly in the Report Footer's On Format event, in my case I needed to do other things in the On Format event, so I made it into a Sub)

Share:
14,639
Aducci
Author by

Aducci

Updated on June 08, 2022

Comments

  • Aducci
    Aducci about 2 years

    In Microsoft Access 2007,

    Is there a way to display the Report Footer section at the bottom of the last page? Right now my Report Footer section always follows my Detail section, so it ends up anywhere.

    I would like to avoid using VBA as much as possible.

  • BIBD
    BIBD over 12 years
    The negative to this is expands the size of your footer (and there's no way to let it shrink) when TextBoxName is not visible.