Force report footer at bottom

G

Guest

Someone gave me this code ealier this week but i'm not sure where i need to
put it....DO I PUT IT IN A NEW MODULE AND IF SO WHAT DO I DO WITH IT AFTER
THAT....I'm not that experienced with this so any help would be great...

Crystal




How to force a report footer to appear at the bottom of the last page:

Make sure that you have a control with a control source of "= [Page] & " of
" & [Pages]" in the Page Footer. Code the report as follows:

Option Compare Database
Option Explicit

Dim mlngPageFooterTop As Long

Private Sub PageFooter_Format(Cancel As Integer, FormatCount As Integer)

If Me.Pages = 0 Then mlngPageFooterTop = Me.Top

End Sub

Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)

Dim ctl As Control
Dim lngHeightDiff As Long

If Me.Pages <> 0 Then
lngHeightDiff = mlngPageFooterTop - Me.Top -
Me.Section(acFooter).Height
If lngHeightDiff > 0 Then
Me.Section(acFooter).Height = mlngPageFooterTop - Me.Top
For Each ctl In Me.Section(acFooter).Controls
ctl.Top = ctl.Top + lngHeightDiff - 10
Next
End If
End If

End Sub
 
J

Jeff Boyce

Since "someone gave you the code earlier in the week", I'd suggest you post
this request as a response to that earlier thread. The person who helped
before (or folks who were following that thread) would be the ones most
likely to understand the background...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

I did and they didn't respond....

Thanks anyways.

Jeff Boyce said:
Since "someone gave you the code earlier in the week", I'd suggest you post
this request as a response to that earlier thread. The person who helped
before (or folks who were following that thread) would be the ones most
likely to understand the background...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Crystal T said:
Someone gave me this code ealier this week but i'm not sure where i need
to
put it....DO I PUT IT IN A NEW MODULE AND IF SO WHAT DO I DO WITH IT AFTER
THAT....I'm not that experienced with this so any help would be great...

Crystal




How to force a report footer to appear at the bottom of the last page:

Make sure that you have a control with a control source of "= [Page] & "
of
" & [Pages]" in the Page Footer. Code the report as follows:

Option Compare Database
Option Explicit

Dim mlngPageFooterTop As Long

Private Sub PageFooter_Format(Cancel As Integer, FormatCount As Integer)

If Me.Pages = 0 Then mlngPageFooterTop = Me.Top

End Sub

Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)

Dim ctl As Control
Dim lngHeightDiff As Long

If Me.Pages <> 0 Then
lngHeightDiff = mlngPageFooterTop - Me.Top -
Me.Section(acFooter).Height
If lngHeightDiff > 0 Then
Me.Section(acFooter).Height = mlngPageFooterTop - Me.Top
For Each ctl In Me.Section(acFooter).Controls
ctl.Top = ctl.Top + lngHeightDiff - 10
Next
End If
End If

End Sub
 
J

Jeff Boyce

Since most folks here are volunteering their time, there's a chance none of
your earlier responders have had a chance to get back to you yet.

Another reason for no response might be because nobody has an idea...

For your code to work, it has to be "behind" the report you want it to work
in.

Regards

Jeff Boyce
Microsoft Office/Access MVP

Crystal T said:
I did and they didn't respond....

Thanks anyways.

Jeff Boyce said:
Since "someone gave you the code earlier in the week", I'd suggest you
post
this request as a response to that earlier thread. The person who helped
before (or folks who were following that thread) would be the ones most
likely to understand the background...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Crystal T said:
Someone gave me this code ealier this week but i'm not sure where i
need
to
put it....DO I PUT IT IN A NEW MODULE AND IF SO WHAT DO I DO WITH IT
AFTER
THAT....I'm not that experienced with this so any help would be
great...

Crystal




How to force a report footer to appear at the bottom of the last page:

Make sure that you have a control with a control source of "= [Page] &
"
of
" & [Pages]" in the Page Footer. Code the report as follows:

Option Compare Database
Option Explicit

Dim mlngPageFooterTop As Long

Private Sub PageFooter_Format(Cancel As Integer, FormatCount As
Integer)

If Me.Pages = 0 Then mlngPageFooterTop = Me.Top

End Sub

Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As
Integer)

Dim ctl As Control
Dim lngHeightDiff As Long

If Me.Pages <> 0 Then
lngHeightDiff = mlngPageFooterTop - Me.Top -
Me.Section(acFooter).Height
If lngHeightDiff > 0 Then
Me.Section(acFooter).Height = mlngPageFooterTop - Me.Top
For Each ctl In Me.Section(acFooter).Controls
ctl.Top = ctl.Top + lngHeightDiff - 10
Next
End If
End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top