Results 1 to 2 of 2
  1. #1
    rlsublime is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2012
    Posts
    58

    Form Checkbox Query

    I currently have 3 checkboxes that I am trying to add a filter query to. I am using the current if statement below. It displays the result of the checkbox selected. It does not work when I try to select multiple boxes or all three boxes or box one and two etc. Is there a way to edit the following iif statement to be able to generate a query with multiple boxes selected. Thanks


    IIf([Forms]![AdminReport]![chkbx_investor]=-1,"Investor",IIf([Forms]![AdminReport]![chkbx_mi]=-1,"MI",IIf([Forms]![AdminReport]![chkbx_makewhole]=-1,"Make Whole")))

  2. #2
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by rlsublime View Post
    I currently have 3 checkboxes that I am trying to add a filter query to. I am using the current if statement below. It displays the result of the checkbox selected. It does not work when I try to select multiple boxes or all three boxes or box one and two etc. Is there a way to edit the following iif statement to be able to generate a query with multiple boxes selected. Thanks


    IIf([Forms]![AdminReport]![chkbx_investor]=-1,"Investor",IIf([Forms]![AdminReport]![chkbx_mi]=-1,"MI",IIf([Forms]![AdminReport]![chkbx_makewhole]=-1,"Make Whole")))
    What do you wnat returned if all three check boxes are checked? Or if only the first two are checked?



    BTW, the correct syntax for the IIF() function for the above example is:
    Code:
    IIf([Forms]![AdminReport]![chkbx_investor]= TRUE,"Investor", IIf([Forms]![AdminReport]![chkbx_mi]= TRUE,"MI", IIf([Forms]![AdminReport]![chkbx_makewhole]=TRUE,"Make Whole","Nada")))
    You are missing the part in RED.

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

Similar Threads

  1. Updating a Checkbox in a Form
    By groovnvirginia in forum Forms
    Replies: 3
    Last Post: 02-15-2012, 08:29 AM
  2. Creating a checkbox form
    By Patti in forum Access
    Replies: 1
    Last Post: 01-25-2012, 05:06 PM
  3. Datestamp for Checkbox-Query
    By Ran in forum Programming
    Replies: 24
    Last Post: 01-18-2012, 11:22 AM
  4. checking a query when marking a checkbox
    By vt800c in forum Access
    Replies: 2
    Last Post: 05-13-2011, 08:53 AM
  5. Disable checkbox on a form
    By caffe in forum Forms
    Replies: 2
    Last Post: 09-16-2010, 07:37 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