Show Totals with Detail

B

bw

I want to make sure that totals for a group do not appear on a page by themselves.

In Sorting and Grouping, my group has...
Group Header = No
Group Footer = Yes
Group On = Each Value
Group Interval = 1
Keep Together = With First Detail

The Group Footer has Keep Together and Visible = Yes, all others are No.

I have a Count expression in the Group Footer.

Isn't this configuration suppose to keep the Count expression from printing on a page by itself?

What am I doing wrong?

Thanks,
Bernie
 
B

bw

The Total is still appearing on a page by itself.
I forgot to tell you that I had also tried your suggestion earlier.

So do you have another suggestion?

Thanks,
Bernie
 
M

Marshall Barton

bw said:
I want to make sure that totals for a group do not appear on a page by themselves.

In Sorting and Grouping, my group has...
Group Header = No
Group Footer = Yes
Group On = Each Value
Group Interval = 1
Keep Together = With First Detail

The Group Footer has Keep Together and Visible = Yes, all others are No.

I have a Count expression in the Group Footer.

Isn't this configuration suppose to keep the Count expression from printing on a page by itself?

What am I doing wrong?


You're not doing anything wrong. With First Detail only
applies to the group header, unfortunately, there is no
corresponding With Last Detail.

The only way I can think of doing this is to check the page
position of the last detail and if there isn't enough room
for both the detail and the footer, make a Page Break
control visible.

To determine when you're formatting the last detail, create
a text box in the group header. Name it txtGrpDetailCnt,
and set the control source to =Count(*). Make the header
invisible if you have no other use for it.

Next, add an invisible text box named txtLineCnt to the
detail section. Set its control source to =1 and RunningSum
to Over Group.

Also add a Page Break control named pgEject to the top of
the detail section.

Now you can use some code in the detail section's Format
event:

Me.pgEject.Visible = (txtLineCnt = txtGrpDetailCnt) _
And (Me.Top > 9 * 1440)

where the 9 is paper height less the page footer height less
the detail height. Play around with it to get it pinned
down.
 
B

bw

You're not doing anything wrong. With First Detail only
applies to the group header, unfortunately, there is no
corresponding With Last Detail.

The only way I can think of doing this is to check the page
position of the last detail and if there isn't enough room
for both the detail and the footer, make a Page Break
control visible.

To determine when you're formatting the last detail, create
a text box in the group header. Name it txtGrpDetailCnt,
and set the control source to =Count(*). Make the header
invisible if you have no other use for it.

Next, add an invisible text box named txtLineCnt to the
detail section. Set its control source to =1 and RunningSum
to Over Group.

Also add a Page Break control named pgEject to the top of
the detail section.

Now you can use some code in the detail section's Format
event:

Me.pgEject.Visible = (txtLineCnt = txtGrpDetailCnt) _
And (Me.Top > 9 * 1440)

where the 9 is paper height less the page footer height less
the detail height. Play around with it to get it pinned
down.

Marsh,
I get the following compile error: Method or data member not found
I don't see what wrong. Both txtLineCnt and txtGrpDetailCnt are text boxes on my
report.

Do you have a suggestion?

Thanks,
Bernie
 
M

Marshall Barton

bw said:
I get the following compile error: Method or data member not found
I don't see what wrong. Both txtLineCnt and txtGrpDetailCnt are text boxes on my
report.

Do you have a suggestion?


Double check the name of the Page Break control.

If that's not it, post the whole Detail_Format procedure and
any other details that might give me a clue.
 
B

bw

Marsh,

It was in fact the wrong name for the page break. I thought I had checked everything.
Sorry to have bothered you with this. And again, thanks for your help.

Bernie
 
M

Marshall Barton

bw said:
It was in fact the wrong name for the page break. I thought I had checked everything.
Sorry to have bothered you with this. And again, thanks for your help.

You're welcome, and don't lose any sleep over it ;-)

We've all been there and done that - more than once.
 
Top