Darrell said:
I know how to avoid part of a detail record being orphaned from its
parent on the previous page. However... how does one keep the report
footer from being orphaned since it is not "part of" anything else?
If I understand yout meaning of "orphan" to be on a page by
itself, then you have to use code to make sure that the last
detail is not near the bottom of the page.
First you need a way to determine when you are processing
the last detail. Add a hidden text box (named
txtTotalDetails) to the report header section and set its
control source expression to =Count(*). Then add a
hidden(?) text box (named txtDetailCount) to the detail
section. Set its control source expression to =1 and its
RunningSum property to Over All. Now add a Page Preak
control (named pgEject) to the top of the detail section.
With that done, add a line of code to the detail section's
Format event procedure:
Me.pgEject.Visible = (txtTotalDetails = txtDetailCount) _
And (Me.Top > 10 * 1440 - Me.Section(2).Height _
- Me.Sectopn(0).Height)
Replace the 10 with your paper height (in inches) less the
top margin.
If your detail section or report footer has its CanGrow
property set to Yes, then it is not possible to do this
accurately.