Results 1 to 3 of 3
  1. #1
    gaker10 is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2014
    Posts
    262

    Query criteria using an "Or" operation


    Refers to thread: https://www.accessforums.net/databas...nly-47170.html


    I have the query which updates four fields based on a key column. I accidently ran it without putting in values for one of my fields to be updated (the date). Now it won't update anything because all fields must be null for it to do anything. The criteria is that the field is empty or null (Zero String not allowed). Basically, I want my criteria to perform an or operation in that it will update field1 if its null or field2 if its null or field3 if its null etc. Right now it only updates if ALL the fields are null. I'd like to avoid code for this. Query:

    Click image for larger version. 

Name:	queries2.png 
Views:	9 
Size:	9.3 KB 
ID:	18228

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    The OR is represented by moving an IS NULL to a different line. You have them all on 1 line.
    You will need 1 IS NULL on 4 different lines. (like a stair step)

  3. #3
    gaker10 is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2014
    Posts
    262
    Excellent! Thank you.

    Click image for larger version. 

Name:	queries2.png 
Views:	7 
Size:	9.9 KB 
ID:	18230

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

Similar Threads

  1. Replies: 3
    Last Post: 12-17-2013, 08:27 AM
  2. Replies: 4
    Last Post: 06-22-2012, 04:00 AM
  3. Replies: 5
    Last Post: 03-05-2012, 08:06 AM
  4. Passing criteria "NULL" or "IS NOT NULL" to a query
    By SgtSaunders69 in forum Forms
    Replies: 1
    Last Post: 12-24-2011, 02:22 AM
  5. Replies: 1
    Last Post: 06-07-2011, 09:10 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