Computer Learning Zone CLZ Access Excel Word Windows

It is not enough to have a good mind. The main thing is to use it well.

-Rene Descartes
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Visitor Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Multiple field criteria in query
Roxi Zardo 

4 years ago
I have an access database that has a main form with a subform. The subform is based on a query that needs to only show records where the "status" field is not "ef complete ", "mail in", or "not Ef" AND the "fee status" field is blank or " billed ".

The status criteria is working, but even if status is blank if I mark it paid, waived, trade, etc in the fee status it disappears.

Currently the criteria is as follows:
Status:
Criteria: <> "ef complete" or "mail in" or "Not EF"
Or: is null
Fee status:
Criteria: is null or "billed"

I've been stuck in this all dang day. Any help would be appreciated.
Kevin Yip  @Reply  
     
4 years ago
The reason it doesn't work is that in the condition [status] <> "ef complete", if [status] is null, this condition is NOT true.  That's because Null <> "ef complete" doesn't evaluate to either true or false; it evaluates to NULL.  You can test this in the VBA editor's immediate window (see picture below).

Comparison to Null only works with IS NULL or IsNull().  It does not work with string comparison operators: <>, >, <, =, >=, NOT IN, etc.  That's because Null is not a string.  So you need to add IS NULL or IsNull() to your criteria.  E.g.:

     status NOT IN ('ef complete', 'mail in', 'Not EF') OR status IS NULL

Another way is to turn [status] into a string by concatenating it with the empty string "":

     status & "" NOT IN ('ef complete', 'mail in', 'Not EF')

The above works even without IS NULL or IsNull because status & "" becomes an empty string if status is null, allowing the use of string comparison operators.
Kevin Yip  @Reply  
     
4 years ago

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Visitor Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/9/2026 8:44:25 AM. PLT: 1s