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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

counting check boxes

Status
Not open for further replies.

MPH03

MIS
Oct 18, 2003
13
US
HI !! Did not type correct subject.....trying it again.. I am trying to total the number of yes checked boxes on my report in the footer, only want to total the number of checked...do not want total not checked....my current expression is:
=Sum([field name])....but it is not calculating correctly...can I do what I want to do with check boxes... thanks !!!!
 
You can use this
=Abs(Sum([FieldName] = -1))
This will total Yes'


Paul


 
Hi, Paul
I was just about to answer this with something I pulled off the Microsoft Knowledge Base, article 209505.

The function that I worked out following reading that article is =Sum(IIf([Check]=True,1,0))

Why do check boxes not respond to the Count function?

Tom
 
Hi Tom. As far as I know, it doesn't matter whether it's a textbox or checkbox, neither will respond to the Count function if you are testing for a specific value probably because they return a boolean value and the count function doesn't know what to do with a boolean where Sum() does. I started using the
Abs(Sum([Check2] = -1))
instead of the expression you have just because it's a little shorter. I picked it up reading some dhookum and CosmoKramer posts.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top