Logo

My Access Tips for Custom Microsoft Access

Application Development

by Matthew V Carmichael


Need Help?

My Tips


Links

Resources
Quick Tip Details
Question:
How do I handle Null values in my SQL or code?
Answer:
Null values can cause issue when trying to evaluate information. For example, the following code returns null:
Debug.Print 1 + 2 + null

Handling null values can be accomplished several ways.
For SQL a very simple and effective method is to use the Nz() function.
For VBA code, use the IsNull() Function.
Code:
SQL
Debug.Print 1 + 2 + nz(null,0)

VBA
If Isnull(1 + 2 + null) then msgbox "Null Value Check goes here"