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

counting records with check boxes 1

Status
Not open for further replies.

new57

Programmer
Nov 3, 2001
17
US
can anyone tell me how to do a count of records with checkboxes?

in other words i have 10 columns that use check boxes to indicate yes/no. i want to do a total for each of these columns when the record has a check mark in it.

but, when access uses the count(*) property, it also counts the unchecked boxes also.

thanks
 
It sounds like your database is not normalized properly. Here is the problem. You want to count only those fields whose value is true. To get this count you need to set it's criteria to true. The problem is, you'll need to set each field's criteria to true and when you do you'll only get a count of when ALL field's are checked (unless you place each criteria on it's own row, in which case you're back to the problem you have now). The way around this is to have a seperate query for each field, setting it's criteria to true and getting a count. Unfortunately this means you'll have to have 11 queries, 1 for each field and 1 to get all the queries together so you can build a meaningful report. If, instead, you'll normalize your data you can then do this with a single query and be able to do a lot of other things better as well. For example, you wont' have to store "empty" fields and you'll be able to add as many questions as you'd like. It would be far more flexible and efficient.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top