Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2009
    Posts
    5

    Unanswered: Choose Function with a checkbox

    Can the choose function be used with a checkbox when doing a query by form? I would like to use a triple state check box (to query a yes no field) and have all values returned if the check box is greyed.

    I can only get the yes or the no, not all.

    I welcome any guidence.

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    Welcome to the forums

    Personally, if it's a query by form, I usually prefer to build the query via VBA. Not sure of your setup though (don't know your skill level either).
    Me.Geek = True

  3. #3
    Join Date
    Jun 2009
    Posts
    5
    The field I need to bring in is called resolved. It is a yes no field. I am trying to do a query by form where resolved is one of the choices. Sometimes the user would not know what value this field has. I have tried asking if this will work with nz but received no replies. I suspect when I submit this for review I will be asked to use a check box and not an option group, so I am trying to work this out ahead of time...

    Attached are some screen shots so you can see what I am trying

    my SQL is here:
    SELECT Sheet1.full_account, Sheet1.name, Sheet1.telephone, Sheet1.due_dt, Sheet1.note1, Sheet1.resolved
    FROM Sheet1
    WHERE (((Sheet1.due_dt)>=nz([Forms]![Form1]![Due Date],"1/1/1965")) AND ((Sheet1.note1) Like "*" & nz([Forms]![Form1]![Text0],"*") & "*") AND ((Sheet1.resolved)=Choose([Forms]![Form1]![Frame11]+2,True,False,[resolved])));

    I do not know VBA but I am happy to try with some direction. I have only been using Access since December, so I am a beginner.
    Attached Files Attached Files

  4. #4
    Join Date
    Jun 2007
    Location
    Maitland NSW,Australia
    Posts
    388
    The field I need to bring in is called resolved. It is a yes no field.
    My question would be why would you use a Triple State?

    A Triple state can have the following values True, False or Null. You could use a Case statement for youe SQL.

    Select case "checkbox name"
    case True
    sql code for TRUE condition
    case False
    sql code for FALSE condition
    case Else
    sql code for NULL condition
    end select

  5. #5
    Join Date
    Jun 2009
    Posts
    5
    Sounds great. I will read up and give it a try.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •