Results 1 to 3 of 3
  1. #1
    lizzywu is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    41

    Group by three checkboxes

    I have three checkboxes as check1, check2, check3. There can be 7 types of their combination (check1, check2, check3, check1&2, check2&3, check1&3, check 1, 2&3). And I want to group data by these seven combos in one report.



    Is there any way to do that?

    Thank you.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    You would have to assign a value to each record dependent on what boxes are checked and then group by that value. In a query, or in Calculated field of table, have nested IIF expression. Seven is supposed to be the limit for nested IIF, so you just might be able to do it.

    IIF(combo1=Yes and combo2=Yes And combo3=Yes,7,IIF(combo2=Yes And combo3=Yes,6,IIF(combo1=Yes And combo3=Yes,5,IIF(combo1=Yes And combo2=Yes,4,IIF(combo3=Yes,3,IIF(combo2=Yes,2,IIF (combo1=Yes,1,"")

    or try Switch function
    Switch(combo1=Yes And combo2=Yes And combo3=Yes,7, combo2=Yes And combo3=Yes,6, combo1=Yes And combo3=Yes,5, combo1=Yes And combo2=Yes,4, combo3=Yes,3, combo2=Yes,2, combo1=Yes,1)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    lizzywu is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    41
    Thank you so much, June.
    Both IIF and Switch functions work well in my query. Problem solved!
    Last edited by lizzywu; 10-13-2011 at 07:38 AM.

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

Similar Threads

  1. Checkboxes ?
    By Trojnfn in forum Access
    Replies: 3
    Last Post: 09-30-2011, 01:52 PM
  2. Reports and Checkboxes
    By seah0rse in forum Access
    Replies: 1
    Last Post: 06-07-2011, 03:37 AM
  3. Replies: 5
    Last Post: 11-29-2010, 08:16 AM
  4. Clear all checkboxes?
    By thekruser in forum Forms
    Replies: 2
    Last Post: 09-16-2010, 09:50 AM
  5. columns for group detail but not group header?
    By Coolpapabell in forum Reports
    Replies: 0
    Last Post: 08-21-2009, 08:53 AM

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