Results 1 to 2 of 2
  1. #1
    Vbinet1 is offline Novice
    Windows 8 Access 2016
    Join Date
    Sep 2017
    Posts
    4

    Apply nested query criteria

    Not sure if this can be done. Referencing a field via dlookup in a query but want no criteria applied if the result is 0.

    So if dlookup (blah)=0 then give me all results, otherwise just give me the results where they equal the value in (blah).

    Am I too far off the mark here?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    DLookup() returns Null if there is no match.

    Is the field a text type?

    So try:

    LIKE DLookup(...) & "*"
    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.

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

Similar Threads

  1. Pls help with nested query criteria
    By Nyrubi in forum Queries
    Replies: 1
    Last Post: 08-24-2017, 04:25 PM
  2. Criteria controlled nested IIF statement
    By tonycl69 in forum Queries
    Replies: 4
    Last Post: 03-23-2016, 07:50 AM
  3. Selectively Apply Criteria
    By ztpkng in forum Queries
    Replies: 6
    Last Post: 06-24-2014, 11:10 AM
  4. Apply Filter 2 criteria not applying
    By ahightower in forum Forms
    Replies: 4
    Last Post: 07-28-2011, 03:31 PM
  5. nested if statement with two criteria
    By kendra in forum Queries
    Replies: 5
    Last Post: 06-16-2009, 04:07 PM

Tags for this Thread

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