sum of values in checkboxes

Posted on 2012-08-27
Last Modified: 2012-08-31
I have 8 checkboxes fields in a table chk1, chk2, etc.

I would like, in a query, sum up all the 8 checkboxes for each row counting one for the checked ones and zero for the unchecked.

Any idea?

I tried chk1+chk2 but I always get zero...
Question by:fitaliano
    1 Comment
    LVL 65

    Accepted Solution

    Since in Access True = -1 and False = 0, if you do a [chk1]+[chk2] etc. it should return the negative value of how many were checked.   Then just do an abs([chk1]+[chk2]) to convert it to a positive number.  

    Also, if your check box is a triple state, meaning it can contain NULL values, [chk1] is going to have to change to Nz([chk1],0) to convert the NULL values to zero, so you can do the math.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Suggested Solutions

    In the previous article, Using a Critera Form to Filter Records (, the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
    It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
    With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now