Sum of records with checkboxes unchecked

  • Thread starter Thread starter EllenM
  • Start date Start date
E

EllenM

Hello,
I'm preparing a report from a table that has 4 check boxes. In the footer
I'd like a sum of the records where all 4 checkboxes are unchecked.

Thanks in advance for your help.

Ellen
 
I assume you want a count of all the rows where the checkboxes are unchecked.
You need a control source like the following

=Abs(Sum([chkbox1]=False and [chkbox2]=false and [chkbox3] = false and
[chkbox4]=false))

Or

=Count(IIF([chkbox1]=False and [chkbox2]=false and [chkbox3] = false and
[chkbox4]=false),1,Null)

Or
=Sum(IIF([chkbox1] + [chkbox2]+ [chkbox3] + [chkbox4]=0,1,Null))



John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
EllenM said:
I'm preparing a report from a table that has 4 check boxes. In the footer
I'd like a sum of the records where all 4 checkboxes are unchecked.


You could use an expression like:

=Sum(IIf(chk1 + chk2 + chk3 + chk4, 0, amount))
 
Ellen,
Several ways to do that. I usually use the query to make that
calculation.
Assuming each check box is bound to a boolean field.
(A checked boolean field = -1, and an unchecked boolean field = 0)

In query design, create a calculated field...
NoChecks : IIF(Chk1 + Chk2 + Chk3 + Check4 = 0, 1,0)
Place the bound NoChecks field on your report, and in your footer...
= Sum(NoChecks)
would indicate how many records in that group had no checks.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
Thanks, John. Actually, I need the count of the records with unchecked
boxes, so thanks for including how to find it.

Sounds like if I replace "sum" with "count" and the other replies will also
work.

Thanks to all of you. :o)
 
Back
Top