Results 1 to 4 of 4
  1. #1
    otfries is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Jan 2018
    Posts
    6

    Using a field in form as criteria for a query

    I am trying to build a query where the criteria is directly linked to a field in a form. This works except for one problem: I need the query to show all the results if the value in the field is 1. I have the following in there:


    IIf([Forms]![fmStorageTransfer]![SupplierName]=1,Null,[Forms]![fmStorageTransfer]![SupplierName])
    I need something else than "NULL", but nothing seems to work.

  2. #2
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Try

    Code:
    [Forms]![fmStorageTransfer]![SupplierName] OR[Forms]![fmStorageTransfer]![SupplierName] Is Null

    See http://www.theaccessweb.com/queries/qry0001.htm

  3. #3
    otfries is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Jan 2018
    Posts
    6
    Works great. Thanks a lot ssanfu.

  4. #4
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You're welcome.

    Good luck with your project.....

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

Similar Threads

  1. Replies: 5
    Last Post: 01-30-2018, 01:16 PM
  2. Query with criteria a date field of a form
    By panoss in forum Queries
    Replies: 1
    Last Post: 12-22-2014, 09:03 AM
  3. Replies: 3
    Last Post: 03-14-2012, 10:31 AM
  4. Replies: 2
    Last Post: 07-12-2011, 07:53 PM
  5. Replies: 3
    Last Post: 06-03-2009, 07:15 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