Results 1 to 3 of 3
  1. #1
    excelhk is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Apr 2014
    Posts
    2

    IsNull problem in query

    I can’t design my query to work. I think it’s because MeetingLocation is an optional field in my table and the query doesn’t show the empty Meeting Location values. I want to design a query that needs to show the IsNull MeetingLocation values in between dates. How do I get IsNull values to show up in the dates that I want?



    See below:



    Table Fields:
    MeetingLocation (optional), MeetingDate(mandatory), PersonID (mandatory)

    Search Form:
    -MeetingLocation
    -From Date
    -To Date
    -PersonID


    ------


    The user enters some values in the search form...

    Logic of my query:
    - If meeting location and dates are blank then show all values in table.
    - If only From Date and To Date have search form values then show all records in table between From Date and To Date.


    - If only Meeting Location has search form value then show all records in table in that Meeting Location.
    - If all the search form has values then show all records in that table in Meeting Location between From Date and To Date.

  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,954
    Options:

    1. set a DefaultValue for the field in table (or control on form) like "None" so that the field is never null

    2. construct a field in query that handles the null and apply filter to that constructed field

    Nz([MeetingLocation],"none")

    3. Use Or Is Null in the parameter for that field
    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
    excelhk is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Apr 2014
    Posts
    2
    Thanks for the tips!

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

Similar Threads

  1. isnull and not isnull
    By webisti in forum Programming
    Replies: 11
    Last Post: 03-04-2014, 08:44 AM
  2. IIF IsNull
    By angie in forum Forms
    Replies: 11
    Last Post: 12-17-2013, 02:25 PM
  3. Using Between with iif isnull
    By TonyB in forum Queries
    Replies: 5
    Last Post: 09-03-2013, 09:56 AM
  4. If IsNull Value, Then need to be Zero
    By burrina in forum Forms
    Replies: 2
    Last Post: 11-18-2012, 02:53 AM
  5. Query using IIf(IsNull) expression
    By jmartin in forum Queries
    Replies: 3
    Last Post: 12-18-2009, 04:19 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