count the number of checkboxes in a record

F

Frustrated

I have a database with numerous fields and the main form has 7 checkboxes
that confirm that certain processes have been completed.

I need to count the number of checkboxes that have been checked so that
another form shows the supervisor that all processes have been completed
correctly.

I have tried =DCount([field names]+[field names]) also =abs(sum[field
names]+ [field names])) but no luck. It just shows a 0 in the field that I
have the calculation.

Any help would be appreciated
 
J

John W. Vinson

I have a database with numerous fields and the main form has 7 checkboxes
that confirm that certain processes have been completed.

"Fields are expensive, records are cheap". What if the business rules change
and you need to delete one process and add three more? Restructure your table,
redesign all your forms, rebuild all your reports and queries? Ouch!

If you have a many (people?) to many (processes) relationship, model it as a
many to many relationship with three tables: whatever your current table is
now; a table of Processes (with seven rows, at least at the moment); and a
third table with links to the primary key of the current table and to the
primary key of the processes table.
I need to count the number of checkboxes that have been checked so that
another form shows the supervisor that all processes have been completed
correctly.

I have tried =DCount([field names]+[field names]) also =abs(sum[field
names]+ [field names])) but no luck. It just shows a 0 in the field that I
have the calculation.

Since a Yes/No field is stored as -1 for True and 0 for False, try simply

=Abs([fieldname] + [fieldname] + [fieldname]...)
 
F

Frustrated

Doesn't work I am afraid. The field with the calculation show a 0 when no
checkboxes has been clicked. When the first box is clicked, the calculation
field shows 10? and when the 2nd box is clicked, the field comes up with an
#Error


John W. Vinson said:
I have a database with numerous fields and the main form has 7 checkboxes
that confirm that certain processes have been completed.

"Fields are expensive, records are cheap". What if the business rules change
and you need to delete one process and add three more? Restructure your table,
redesign all your forms, rebuild all your reports and queries? Ouch!

If you have a many (people?) to many (processes) relationship, model it as a
many to many relationship with three tables: whatever your current table is
now; a table of Processes (with seven rows, at least at the moment); and a
third table with links to the primary key of the current table and to the
primary key of the processes table.
I need to count the number of checkboxes that have been checked so that
another form shows the supervisor that all processes have been completed
correctly.

I have tried =DCount([field names]+[field names]) also =abs(sum[field
names]+ [field names])) but no luck. It just shows a 0 in the field that I
have the calculation.

Since a Yes/No field is stored as -1 for True and 0 for False, try simply

=Abs([fieldname] + [fieldname] + [fieldname]...)
 
J

John W. Vinson

Doesn't work I am afraid. The field with the calculation show a 0 when no
checkboxes has been clicked. When the first box is clicked, the calculation
field shows 10? and when the 2nd box is clicked, the field comes up with an
#Error

Please post the following:

1. Open the Form in design view and view its Properties. What is the
Recordsource property? If it's a Query please open the query in SQL view and
post the SQL text here. If it's a table, please post the fieldnames and
datatype of each field.
2. Post the Control Source properties of the controls you're summing.
3. Post the actual Control Source expression of the calculated control.
 

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

Top