Results 1 to 4 of 4
  1. #1
    ShostyFan is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    76

    form search query and is null

    I have a basic search form that sets query parameters.
    The query criteria is: [Forms]![Search_Form]![cmbo_Category]
    And this works fine as long as a value is set in the search form, if no value is set there are 0 results.
    I want the user to be able to select a category or leave the category blank to return all values.


    Sadly this does not work: [Forms]![Search_Form]![cmbo_Category] OR is null

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    use: Like Nz([Forms]![Search_Form]![cmbo_Category],"*")

    Cheers,
    Vlad

  3. #3
    ShostyFan is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    76
    disco!
    worked perfectly! Thanks.

  4. #4
    Minty is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    You were close, if you use
    [Forms]![Search_Form]![cmbo_Category] OR [Forms]![Search_Form]![cmbo_Category] is null
    it will work, and is more efficient that the wildcard.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

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

Similar Threads

  1. Replies: 24
    Last Post: 04-08-2015, 02:59 PM
  2. Replies: 7
    Last Post: 11-22-2012, 08:03 AM
  3. Replies: 11
    Last Post: 11-09-2012, 08:17 AM
  4. Replies: 7
    Last Post: 05-23-2012, 02:19 PM
  5. Query search wont display null fields
    By Coffee in forum Queries
    Replies: 2
    Last Post: 08-08-2011, 09:00 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