Results 1 to 3 of 3
  1. #1
    maxx102 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    14

    Counting Checkboxes

    Hello everyone, I've tried consulting the ever mighty Google and I can't seem to find the answer that I am looking for.



    I have a query that I am trying to create that counts the four different safety teams at my corporate office. We track the building, the floor, and the four teams based upon the team member's cubical location. The query displays the building and floor correctly but it doesn't display the 4 safety teams correctly.

    I am using checkboxes to select whether someone is on a particular team or teams. Is there a way to have the system only count the check boxes and disregard the empty boxes? based upon what I am seeing, it seems my query is counting the boxes regardless if the box is checked or not. From what I am seeing online, I guess I can do it using SQL but I am not sure how.....

    How can I set this up using the Design View mode of the query I am using?

    I am also using Access 2010 edition if that matters any.

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    The correct answer depends on whether you have an Option Group (of check boxes) or whether you have individual checkboxes.

    With individual checkboxes, when they are checked, their value = -1. And so you need to sum rather than count. You can flip flop to a positive number display using an Absolute Value function abs()

    With option groups then each check box will make the option group control have a value; probably 1-4. you would need to count the 1s vs 2s vs 3s vs 4s.

    Hope this gets you going in the right direction.

  3. #3
    maxx102 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    14
    I think they are individual checkboxes. Below is what is shown in "SQL view".


    SELECT [Safety Teams Database].[Building Location], [Safety Teams Database].Floor, Count([Safety Teams Database].[CEAT Floor Captain]) AS [CountOfCEAT Floor Captain], Count([Safety Teams Database].ERT) AS CountOfERT, Count([Safety Teams Database].WARN) AS CountOfWARN, Count([Safety Teams Database].CERT) AS CountOfCERT
    FROM [Safety Teams Database]
    GROUP BY [Safety Teams Database].[Building Location], [Safety Teams Database].Floor
    ORDER BY [Safety Teams Database].[Building Location], [Safety Teams Database].Floor;

Please reply to this thread with any new information or opinions.

Similar Threads

  1. IF Statement for checkboxes
    By Ran in forum SQL Server
    Replies: 16
    Last Post: 02-09-2012, 06:12 PM
  2. Group by three checkboxes
    By lizzywu in forum Reports
    Replies: 2
    Last Post: 10-12-2011, 09:22 PM
  3. Checkboxes ?
    By Trojnfn in forum Access
    Replies: 3
    Last Post: 09-30-2011, 01:52 PM
  4. Clear all checkboxes?
    By thekruser in forum Forms
    Replies: 2
    Last Post: 09-16-2010, 09:50 AM
  5. Replies: 2
    Last Post: 08-31-2006, 12:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums