A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Count check boxes



 
 
Thread Tools Display Modes
  #1  
Old August 17th, 2005, 03:06 PM
jeannette_rivera
external usenet poster
 
Posts: n/a
Default 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  
Old August 17th, 2005, 03:27 PM
Klatuu
external usenet poster
 
Posts: n/a
Default

=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  
Old August 17th, 2005, 04:28 PM
Sprinks
external usenet poster
 
Posts: n/a
Default

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  
Old August 17th, 2005, 05:00 PM
jeannette_rivera
external usenet poster
 
Posts: n/a
Default

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  
Old August 18th, 2005, 01:42 AM
jeannette_rivera
external usenet poster
 
Posts: n/a
Default

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  
Old August 18th, 2005, 01:45 AM
jeannette_rivera
external usenet poster
 
Posts: n/a
Default

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  
Old August 18th, 2005, 04:20 AM
Sprinks
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 09:41 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.