But I do not want to print my last section of stuff after the detail
section... I want it at the Bottom of the last page!
I included that top property in my else clause. It did not help.
:
Told you it wasn't easy < g >.
Trying to set the height property of the report footer section while in
the
page footer section probably is going to lead to problems. I also note
that
you're not setting the Top property of the Txt2 textbox in the "Else"
portion of the block.
In order for ACCESS to "generate" a report where you are using the Pages
property, it must format every page of the report in order to get a Pages
value, then it formats each page again as you print/view it. Thus, it's
possible for ACCESS to become confused, as you're seeing.
I've run across another trick that might work for you. Are you using a
grouping in the detail section? If not (or even if you are), create a new
group as the first group (Sorting and Grouping menu), and group on the
number 1. Select to have group header and footer sections. Then put your
"last page" data in that group's footer section. This section will print
only after all data have been printed in the Detail section. That also
may
do what you seek.
--
Ken Snell
<MS ACCESS MVP>
oops, I take it back. It worked fine while previewing the report on
the
screen. But it PRINTS ON THE PRINTER TOTALLY DIFFERENTLY!!
Unbelievable.
For example, instead of 5 pages it prints 6 pages. (and on the 5th
page
my
textbox even shows page 5 of 5). Here is my code:
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
If ([Page] = Pages) Then
Me.txt1.Visible = True
Me.Txt2.Visible = True
Me.PageFooterSection.Height = 3 * 1440
Me.ReportFooter.Height = 0 * 1440
Me.Txt2.Top = 1 * 1440
Else
Me.txt1.Visible = False
Me.Txt2.Visible = False
Me.PageFooterSection.Height = 0 * 1440
Me.ReportFooter.Height = 3 * 1440
End If
:
Well, now, I find that the code doesn't do what I had thought.... but
if
you
put an invisible textbox in the page footer section that uses an
expression
involving the [Pages] property (control source would be
=[Pages]
)
then it will work. Reports sometimes require a control to be on the
report
where the control uses a field that is being used in code or other
controls
or properties.
--
Ken Snell
<MS ACCESS MVP>
are you sure about this stuff? I can't even get this to work:
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount
As
Integer)
If ([Page] = [Pages]) Then
Me.Label11.Visible = True
End If
End Sub
that should turn on the visibility of the label that is in the page
footer
section... But it doesn't.
Earlier I had mixed success turning that label's visibility on and
off
(on
page 2 for example) but it doesn't seem consistent. I think I am
missing
something here.
:
Additional note....
If the label is at the top of the page footer section, changing its
height
most likely will still leave white space, as the section's height
is
not
being changed as well. You'd also need to reduce the height of the
footer
section and change the Top property of the controls that are below
that
label. (You're now seeing an example of what my first reply was
suggesting
would be involved with trying to change the location of the report
footer.)
--
Ken Snell
<MS ACCESS MVP>
message
Then change its height to zero when you make it invisible:
Select Case ([Page]=[Pages])
Case True
Me.ControlName.Visible = True
Me.ControlName.Height = 1440 * NumberOfInchesHigh
Case False
Me.ControlName.Visible = False
Me.ControlName.Height = 0
End Select
--
Ken Snell
<MS ACCESS MVP>
OK, I have just tried this. The problem with this approach is
that
the
control still wastes space on the first pages where it is not
visible.
I
can
turn the label's visibility on and off fine (making it visible
only
on
the
last page) but it is a pretty big control (2" high at least) and
it
looks
terrible to have 2" of blank space at the bottom of those first
pages...
:
Actually, you might be able to use the Page Footer section for
what
you
seek.
You can put code in the Format event of the PageFooter section
to
test
if
[Page]=[Pages], and use that for setting the visible property
of
the
textboxes/controls that are to print only on the last page.
Me.ControlName.Visible = ([Page]=[Pages])
This might get you what you want more easily.
--
Ken Snell
<MS ACCESS MVP>
message
Sorry... I slightly misread your question. No, you're correct
in
what
you
see.. the report footer prints after the last data record for
the
report.
There is no built-in way to make the report footer go to the
bottom.
You
must do it via some "tricky" programming that has to check
the
"height" of
the last page, determine the "height" of your footer,
subtract
the
two,
and calculate how much "white space" to be put into the
footer,
which
probably would be done by changing the height of the
textboxes
in
the
footer and then adding blank lines to the beginning of the
text
in
those
textboxes so that the data print at the bottom.
However, Stephen Lebans may have something already worked out
for
this...
see his site
www.lebans.com.
--
Ken Snell
<MS ACCESS MVP>
Hello Ken,
Well, I may be crazy, but I just made a report from
scratch.
I
put
3
records in the table underlying the report, and I added a
report
footer.
I'm
afraid the report footer comes right after the 3rd record!
It
is
definitely
not at the bottom of the page. And this is the easy case,
there
is
only
1
page in my report!
:
Use the Report Footer section for those textboxes... this
section
prints
only at the bottom of the last page.