Counting "true" responses in a Yes/No check box option

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

Guest

I have a form whereupon there are several check boxes. If male, they check
the box, if over40 they check a box. I now need to have a summary form that
has a count of the checked boxes. I have tried =count([male]="true") and
several variations, but I cannot seem to get anything except an error. Any
ideas?
 
Don

You don't say where you are trying to get this count.

You don't say whether the form is bound to an underlying table or not.

If you have Yes/No fields in a table, you can create a query that Sums the
Yes/No field. No = 0, Yes = 1 (or -1, depending on where the data is
stored). Find the sum of the field, then take its Absolute Value. That's
how many "Yes" checks there are.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
it is bound to a query. I have tried using the "sum" in the query but I get
a data type mismatch error. The form is in column format and I want to see
the check boxes for the various fields, but in the footer of the form I am
trying to provide a count of how many boxes in form were checked in the
affirmative.
--
Thanks!


Jeff Boyce said:
Don

You don't say where you are trying to get this count.

You don't say whether the form is bound to an underlying table or not.

If you have Yes/No fields in a table, you can create a query that Sums the
Yes/No field. No = 0, Yes = 1 (or -1, depending on where the data is
stored). Find the sum of the field, then take its Absolute Value. That's
how many "Yes" checks there are.

Regards

Jeff Boyce
Microsoft Office/Access MVP

Don said:
I have a form whereupon there are several check boxes. If male, they check
the box, if over40 they check a box. I now need to have a summary form
that
has a count of the checked boxes. I have tried =count([male]="true") and
several variations, but I cannot seem to get anything except an error.
Any
ideas?
 
Don

Consider posting the SQL expression -- it's hard to diagnose without seeing
what your SQL statement is saying...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Don said:
it is bound to a query. I have tried using the "sum" in the query but I
get
a data type mismatch error. The form is in column format and I want to
see
the check boxes for the various fields, but in the footer of the form I am
trying to provide a count of how many boxes in form were checked in the
affirmative.
--
Thanks!


Jeff Boyce said:
Don

You don't say where you are trying to get this count.

You don't say whether the form is bound to an underlying table or not.

If you have Yes/No fields in a table, you can create a query that Sums
the
Yes/No field. No = 0, Yes = 1 (or -1, depending on where the data is
stored). Find the sum of the field, then take its Absolute Value.
That's
how many "Yes" checks there are.

Regards

Jeff Boyce
Microsoft Office/Access MVP

Don said:
I have a form whereupon there are several check boxes. If male, they
check
the box, if over40 they check a box. I now need to have a summary form
that
has a count of the checked boxes. I have tried =count([male]="true")
and
several variations, but I cannot seem to get anything except an error.
Any
ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top