Testing For Non-Null Strings

Some might test for Null by using

If sSomeString <> "" Then


If Len(sSomeString) = 0 Then

While these might work, it’s 50% faster to use

If IsNull(sSomeString) Then

Check out the other “Is” operators, IsDate, IsEmpty and IsNumeric. Use the correct operator for the job you have to do.


This tip is reprinted from the VB Tips & Tricks Volume 1 book.
Part of this tip was submitted by: Bobby Holstein