Results 1 to 3 of 3
  1. #1
    crimedog is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2013
    Posts
    141

    Query Builder want to filter by Check Box

    I have a check box working the way I want.


    On a true/false field ([Approved]) the criteria
    Code:
    Like IIf(IsNull([forms]![Frm_EquipmentListForEdits]![ChkApproved]),"*",IIf([forms]![Frm_EquipmentListForEdits]![ChkApproved]=True,True,False))
    works the way I want.

    However - essentially the same criteria applied to a text field is acting screwy
    Code:
    Like IIf(IsNull([forms]![Frm_EquipmentListForEdits]![ChkOrdered]),"*",IIf([forms]![Frm_EquipmentListForEdits]![ChkOrdered]=True,Not Is Null,Is Null))
    I would like the check box to show all records when form loads, records that are not empty if ChkOrdered is selected (True Case), and empty records if ChkOrdered is False.
    Not is Null and Is Null has been automatically adding the [table].[field] into the statement : Not ([Table].[field]) Is Null & ([Table].[field]) Is Null

    Also I know spaces in strings can look null but aren't - just starting with Null

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    I've never seen LIKE used with Is Null. Don't think it will work. If you expect Null in field then handle to convert to empty string. Consider:

    Fieldname & "" LIKE IIf(IsNull([forms]![Frm_EquipmentListForEdits]![ChkOrdered]), "*", IIf([forms]![Frm_EquipmentListForEdits]![ChkOrdered]=True, "?*", ""))
    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
    crimedog is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2013
    Posts
    141
    Thanks - I have changed it to radio button control group. Learned something new.

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

Similar Threads

  1. Replies: 16
    Last Post: 02-14-2018, 09:50 AM
  2. Filter query results through check boxes?
    By Homegrownandy in forum Access
    Replies: 9
    Last Post: 01-25-2018, 08:54 AM
  3. Replies: 2
    Last Post: 03-22-2015, 11:16 AM
  4. Replies: 4
    Last Post: 02-03-2014, 12:16 PM
  5. Replies: 1
    Last Post: 04-24-2013, 03:47 PM

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