If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Count check boxes
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. |
#2
|
|||
|
|||
=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! "jeannette_rivera" wrote: 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. |
#3
|
|||
|
|||
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" wrote: 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. |
#4
|
|||
|
|||
Where should I wrote this? In a new text box in the Control Source area? In
the report footer. "Klatuu" wrote: =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! "jeannette_rivera" wrote: 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. |
#5
|
|||
|
|||
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 "Klatuu" wrote: =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! "jeannette_rivera" wrote: 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. |
#6
|
|||
|
|||
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" wrote: 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" wrote: 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. |
#7
|
|||
|
|||
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" wrote: 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" wrote: 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" wrote: 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. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I count mulitple check boxes in one query in Access? | 53Planner | Running & Setting Up Queries | 3 | June 20th, 2005 04:15 PM |
Users want Check Boxes for entry | Melvis | Using Forms | 8 | January 21st, 2005 02:31 AM |
Data returned on check boxes | Pat Dools | Using Forms | 3 | December 4th, 2004 02:05 AM |
Value of check boxes in word form are lost when emailing the form. | Dave Jung | General Discussion | 1 | June 24th, 2004 07:12 PM |
Add & Multiply Check boxes in a column. | Janice | Tables | 1 | April 28th, 2004 06:13 AM |