Totals on Same Page

  • Thread starter Thread starter bw
  • Start date Start date
B

bw

I have a Detail section followed by a group footer that counts occurrences
in the detail section (=Count([Rev]).

I want to make sure that the Count total does not appear at the top of a
page, without first displaying at least one detail line.

Can someone explain how to do this?

Thanks, Bernie
 
bw said:
I have a Detail section followed by a group footer that counts occurrences
in the detail section (=Count([Rev]).

I want to make sure that the Count total does not appear at the top of a
page, without first displaying at least one detail line.


First, add a text box named txtNumDetails to the group
header section. Set its control source to =Count(*)

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

Also add a page Break control named pgNewPage at the very
top of the detail section.

Finally add code like this in the detail section's Format
event:

If txtLine = txtNumDetails Then
pgNewPage.Visible = (Me.Top + Me.Section(0).Height _
+ Me.Section(6).Height > 9 * 1440)
End If

The 9 in the above expression is the number of inches from
the top of the page where the page footer section or bottom
margin starts, change it to suit your page layout.
 
Thank you Marshall.
I appreciate your help.
Bernie


Marshall Barton said:
bw said:
I have a Detail section followed by a group footer that counts occurrences
in the detail section (=Count([Rev]).

I want to make sure that the Count total does not appear at the top of a
page, without first displaying at least one detail line.


First, add a text box named txtNumDetails to the group
header section. Set its control source to =Count(*)

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

Also add a page Break control named pgNewPage at the very
top of the detail section.

Finally add code like this in the detail section's Format
event:

If txtLine = txtNumDetails Then
pgNewPage.Visible = (Me.Top + Me.Section(0).Height _
+ Me.Section(6).Height > 9 * 1440)
End If

The 9 in the above expression is the number of inches from
the top of the page where the page footer section or bottom
margin starts, change it to suit your page layout.
 
Back
Top