Count check boxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I had a report with a list of services, those services shows as check box
with yes/no value in the table. I would like to count the boxes with value
on it, all the ones marked. If I did the count() it count all of them with
or without info on it. Obviously I'm doing something wrong.

You're the best, so I'm sure you can help me fix this.

Thanks.
 
=Abs(Me.chkBox1 + Me.chkBox2 + Me.chkBox3 + Me.chkBox4)

Checkboxes that are checked evaluate as True with a value of -1
Checkboxes that are not checked evaluate as False with a value of 0

If 2 and 3 are True and 1 and 4 are False, then adding the values up returns
-2
So, if you use the Abs function, it drops the sign bit and returns 2.

TaDa!
 
Hi, Jeannette.

Klatuu's response shows how to total the Yes responses of multiple fields in
a single record. To total the number of Yes values in a single field for an
entire table, the following expression in the Detail or Form footer will
return the value:

=Sum(Abs([YourCheckBox])

Sprinks
 
Where should I wrote this? In a new text box in the Control Source area? In
the report footer.
 
Hi Klatuu:

Can you tell me where to put this info? It's in a text box or this is a code?

Sorry for my lack of knowledge. I'm an accountant trying to fly!

Jeannette
 
If I had several text boxes with different names like: New ATM, Loan,
Letter... How can I get sum all the equal ones marked. For example all the
"Loan" Check Box.

sorry but I'm like new in this and really can't get this working.

Jeannette

Sprinks said:
Hi, Jeannette.

Klatuu's response shows how to total the Yes responses of multiple fields in
a single record. To total the number of Yes values in a single field for an
entire table, the following expression in the Detail or Form footer will
return the value:

=Sum(Abs([YourCheckBox])

Sprinks

jeannette_rivera said:
I had a report with a list of services, those services shows as check box
with yes/no value in the table. I would like to count the boxes with value
on it, all the ones marked. If I did the count() it count all of them with
or without info on it. Obviously I'm doing something wrong.

You're the best, so I'm sure you can help me fix this.

Thanks.
 
Jeannette,

I don't understand what you're trying to do. Do you want to total all the
checked boxes for all records in your table or query in the Loan check box,
or all the checked boxes New ATM, Loan, Letter, etc. in the current record?

Sprinks

jeannette_rivera said:
If I had several text boxes with different names like: New ATM, Loan,
Letter... How can I get sum all the equal ones marked. For example all the
"Loan" Check Box.

sorry but I'm like new in this and really can't get this working.

Jeannette

Sprinks said:
Hi, Jeannette.

Klatuu's response shows how to total the Yes responses of multiple fields in
a single record. To total the number of Yes values in a single field for an
entire table, the following expression in the Detail or Form footer will
return the value:

=Sum(Abs([YourCheckBox])

Sprinks

jeannette_rivera said:
I had a report with a list of services, those services shows as check box
with yes/no value in the table. I would like to count the boxes with value
on it, all the ones marked. If I did the count() it count all of them with
or without info on it. Obviously I'm doing something wrong.

You're the best, so I'm sure you can help me fix this.

Thanks.
 
Back
Top