Results 1 to 3 of 3
  1. #1
    olinms01 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    2

    Filter Query based upon Checkboxes

    I have a form with checkboxes to filter a query. One of the checkboxes is for filtering the query to find null entries.

    Here's the code I put into the Criteria field in my query:



    Code:
    IIf([Forms]![MyForm]![A]=True,"Is Null") Or IIf([Forms]![MyForm]![B]=True,"3A")
    I read that IF statements don't like the input of null, but I couldn't figure out how else to connect the checkbox to filter null entries.

    Any help is much appreciated! Thanks in advance!

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    What exactly do you think this IIF statement should do? (in plain English)

  3. #3
    olinms01 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    2
    Quote Originally Posted by orange View Post
    What exactly do you think this IIF statement should do? (in plain English)
    The expression is checking to see if the checkbox on the form is checked and if true, then filter using the "true statement"

    So with the code I have:

    Is checkbox "A" checked? True: Filter for results that are null - False: Nothing

    OR

    Is checkbox "B" checked? True:Filter for results that equal "3A" - False: Nothing

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

Similar Threads

  1. Sharepoint List Query Filter based upon User Login
    By Steven.Allman in forum SharePoint
    Replies: 5
    Last Post: 03-22-2012, 11:30 AM
  2. Replies: 1
    Last Post: 03-05-2012, 07:35 PM
  3. Replies: 4
    Last Post: 07-12-2011, 09:49 AM
  4. Filter records based on multiple checkboxes
    By kbremner in forum Forms
    Replies: 2
    Last Post: 01-18-2011, 10:59 AM
  5. Form Based Query/Filter
    By Micon in forum Access
    Replies: 0
    Last Post: 11-07-2008, 09:25 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