Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Query parameter is null (XP)

    I usually use Like [cboValue] and a union query with * to return all records but now I have a date field and this approach does not work. I remember that I used another method to do a similar thing years ago using an 'or is null' or something similar to get all the records if a parameter was left as null but I can't make it work - can you steer me in the right direction.

  2. #2
    4 Star Lounger
    Join Date
    Dec 2002
    Location
    Kitchener, Ontario, Canada
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query parameter is null (XP)

    Try the thread starting with <post#=336,509>post 336,509</post#> . Everything you want to know about Union queries and using null values (not to mention empty strings).

  3. #3
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Query parameter is null (XP)

    Sorry that's not what I'm after. In the solution I used a few years ago did not use a union query.

    The unbound form supplying the criteria was allowed to provide a null value and the query returned all records when supplied with a null.
    after much fluffing around I got it -
    WHERE (((tblRunner.Runner_Name)=[Forms]![frmCriteria]![cboRunner])) OR ((([Forms]![frmCriteria]![cboRunner]) Is Null))

Posting Permissions

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