On Feb 23, 3:06 pm, "tomleb...@msn.com" <tomleb...@msn.comwrote:
Are the following two validation the same:
1) IsNull(Me.ColumnName) and Me.ColumnName = ""
2) Me.ColumnName """
It would seem to be better to use: Me.ColumnName """
No they are not. One tests for a value (empty strings are values) and
the other sees what of two values is logically greater.
An empty string is less than a 'normal' string and a numeric variable
with no value defaults to 0.
However when doing this and one of the values is Null (mainly when
using variants) the comparison will always fail because a null has no
value to test.
I find the easiest test when you need to know if something is null is
to use the Nz function. If it is, this function lets you force a
different value so that your comparison don't fail.