Print objects only on the last page of a report

J

JimAA

I have a report that needs objects (labels, drawing objects, text boxes with
expressions) in a Report Footer to print at the bottom of the last page of a
multi-page report (or at the bottom of a single page report). After
searching this discussion group it looks like that is not possible. Report
Footers are positioned immediately after the last detail and can appear
anywhere on a page.
Any ideas how I can get the Report Footer to be positioned at the bottom of
the page?

Not finding a solution for the Report Footer, I created text boxes and
labels in the Page Footer section and set the visibile to No. I then used
this code (at the On Format event in the Page Footer properties) to display
on the last page:

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
If [Page] = [Pages] Then
[TotalDue].Visible = True
[Label143].Visible = True
End If
End Sub

In the print preview everything looks good. The bottom of every page is
blank except the last page, which is the way I want it. However, when I
actually print the
report, the objects print on every page.

Any ideas how I can get these objects to only print on the last page?

Thanks.
 
L

Leslie Isaacs

Hello Jim

I'm no expert (I ask more questions here than I answer!), but...
try using
PageFooterSection.Visible
instead of setting the property for the all the individual controls. Don't
know if it will work, but worth a quick try!

HTH
Leslie Isaacs (NVA)
 
J

John Spencer

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

'Once you make the controls visible they stay visible until you make them not
'visible. The easiest way to fix that is to test on every page
'and set the property on each page.

'This should work
[TotalDue].Visible = ([Page] = [Pages])
[Label143].Visible = ([Page] = [Pages])

End Sub

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 

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