Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Count of Check Box

Status
Not open for further replies.

CarrieR

Technical User
Nov 9, 2001
60
US
Question: I have 2 check boxes on a report, one called Technician, another Certification. I am trying to count only the technicians that are certified, such as: =Sum(IIf([Certification]=-1,[Technician])). This works great except the numbers are showing up as negatives. Can anybody help me here?
 
You could use a text box with this control source:

=IIf([Technician],IIf([Certification],1,0),0)

and then set the Running Total property of the text box to 'Over Group' or 'Overall', whichever is appropriate.

-Gary
 
This is a simpler control source for the text box:

=IIf([Technician] And [Certification],1,0)

-Gary
 
Thanks, but neither option above worked. The calculation I originally did is correct, just shows as a negative number. Again I want to count the number of technicians that are certified, not all the technicians.

Thx

 
If you want to count when the Technician AND Certification boxes are both checked, then the control source that I supplied should work, I just didn't put the Sum fuction around it. If your numbers are correct, but they are negative, you might consider passing the entire control source to the Abs() function:

=Abs(Sum(IIf([Certification]=-1,[Technician])))

or just multiply by -1:

=(Sum(IIf([Certification]=-1,[Technician]))*(-1)

Good luck

-Gary
 
Thanks, using ABS in front worked. Appreciate the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top