Footer on same page as last record

G

Guest

I have a group footer subtotalling the values of each group. Sometimes the
group has only 1 record, sometimes 30. The report spans multiple pages.

Sometimes, just due to random spacing, the footer with the subtotals ends up
on the top of one of the pages with all of the data it is referring to on the
previous page. I would like to force it to put at least the last record with
each of the subtotals. In other words, keep together with last record.

Thanks in advance.
 
M

Marshall Barton

Arun said:
I have a group footer subtotalling the values of each group. Sometimes the
group has only 1 record, sometimes 30. The report spans multiple pages.

Sometimes, just due to random spacing, the footer with the subtotals ends up
on the top of one of the pages with all of the data it is referring to on the
previous page. I would like to force it to put at least the last record with
each of the subtotals. In other words, keep together with last record.


Lamentally, there is no feature to do that.

In situations where niether the detail or the group footer
can grow, you can get that effect by checking where the last
detail is on the page.

First, you need to know which details you are processing.
This is done by adding a text box named txtGrpCnt to the
group header section with the expression =Count(*). This
will tell you how many details there are in the group.

Next, add a text box named txtLineNum to the detail section.
Set its control source expression to =1 and RunningSum
property to Over Group.

Also add a page break control named pgBreak at the very top
of the detail section.

Then the detail section's Format event procedure can do this
kind of thing:

If Me.txtLineNum = Me.txtGrpCnt Then
Me.pgBreak.Visible = (Me.Top >= 10 * 1440 - _
Me.Section(0).Height - Me.Section(6).Height
End If

where the 10 is the number of inches on the page less the
bottom margin and page footer section.
 

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