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

sum the total of check boxes 1

Status
Not open for further replies.

NETHROW

Technical User
Oct 18, 2002
12
US
I'm new to access so please reply in detail.

My data base is setup with several check boxes. How do I sum the values of these check boxes and display only the totals in a report? Can this be done without using a pivot table?
Thanks,
Nethrow
 
For each row you can get a total by taking advantage of the fact that a checkbox is -1 if true and 0 if false. If you add a calculated column to the underlying query it could look like this in design mode: Total:Abs(checkbox1 + checkbox2 + checkbox3 + checkbox4, etc) or like this if in SQL Mode: Select ...,Abs(checkbox1 + checkbox2, etc) AS Tot

If you need a group or grand total of the individual checkboxes, create a calculated field in the query for each one giving the field a value of 1 if it is true like so:

TotCheckbox1:IIF(checkbox1, 1, 0)
TotCheckbox2:IIF(checkbox2, 1, 0), etc

or like so:

SELECT ..., IIF(checkbox1, 1, 0) AS TotCheckbox1, IIF(checkbox2, 1, 0) AS TotCheckbox2, etc.

Good Luck! Please remember to give helpful posts the stars they deserve! This makes the post more visible to others in need![thumbsup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top