Subtotals only if more than 1

Val

Registered User.
Local time
Yesterday, 23:14
Joined
Nov 5, 1999
Messages
30
I have a report that has a subtotal based on the Agent group field. Sometimes there are 5 or 6 Agent Codes within the Agent Group so I need to do a subtotal for the entire Group. However sometimes there is only 1 Agent Code. Is there a way to not show the subtotal if there is only Agent Code in that group? Showing the subtotal on these records is a little redundant.
 
I don't know exactly your setup but for the field where you are doing the subtotals use an IIF statement in the controlsource property of you field, such as:

IIF ([AgentGroup] <= 1, [AgentGroup].visible = false, [AgentGroup])
 
You can hade the control (I think) from the On Format event of the section. It would mean writing code to check the number of Agents (Are you counting spies??) first though.
 
Nope - not counting spies! Just Insurance Agents. (Sometimes I'm not sure which is worse)

Thanks for the Suggestions - I got it to work. I created a field in the Agent Group Footer which is where my subtotals are to count the number of Agents in the group. Then I used the following code in the OnFormat Event of the Agent Group Footer.

If [CountAgt#] <= 1 Then
AgentGroupFooter0.Visible = False
Else
AgentGroupFooter0.Visible = True
End If

Thanks for all of your Help!!
Val
 
Last edited:

Users who are viewing this thread

Back
Top Bottom