Filter Query Checkbox Based on Form Textbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pookaroo85
    New Member
    • Nov 2013
    • 34

    Filter Query Checkbox Based on Form Textbox

    I have a form frmCRApproval which has a textbox txtMatrix that I would like to use as criteria in my query qryCRApproval. I would like to change the criteria to checked if txtMatrix is ValueA but leave the criteria as Null if it is not ValueA.

    I currently have IIf([Forms]![frmCRApproval]![txtMatrix]="ValueA",-1,Null) in the criteria.
    Last edited by zmbd; Nov 5 '15, 06:21 AM. Reason: [z{please use the code format for posted script, thnx}]
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1293

    #2
    Pookaroo85, You haven't really shown enough to offer much help. The snippet you show will return a value of -1 or Null, but we can't see what you do with that value. Testing against a null is tricky and you may not have gotten that right.

    Are you really looking for the literal string "ValueA"? You put that in quotes in the code but not in your description, so I am wondering about that. Are you testing some Y/N field against this formula? You have to test for either -1 or 0 if you are because those are the only legal values for a Y/N field.

    You mention a checkbox in the title but there is no other reference to a checkbox in your problem description.

    Please expand on your problem. Thanks.

    Jim

    Comment

    Working...