Subtotal in Last Detail

S

steveh

Is it possible to get a subtotal in the last line of a detail?

Here's an example where the Emp. Total column is what I'm looking to get:

Client Emp. Year Sales Emp. Total
------ ---- ---- ----- ----------
ABC Inc. AAA 2004 10,000
2005 12,000 22,000
BAC 2003 11,000
2004 14,000
2005 18,000 43,000
------
65,000


A running sum over the group would work well _if_ I could get it to be
visible only on the last line of the detail for the group. Does anyone
have any conditional formatting or VBA tricks to accomplish this? Any
other ideas?

Thanks for looking.

Steve
 
D

Duane Hookom

You could try add a text box in the detail section:
Name: txtDCount
Control Source: =1
Running Sum: Over Group
Visible: No
Add a text box to the Group Header section:
Name: txtGHCount
Control Source: =Count(*)

Then in the On Format event of the detail section, use code like:

Me.txtTotalRunningSum.Visible = Me.txtGHCount = Me.txtDCount
 

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