Testing if a textfield is empty or null

odrap

Registered User.
Local time
Today, 13:14
Joined
Dec 16, 2008
Messages
156
Does it make sense to test a textbox on both possiblities namely: being empty or being null.
Is so what's the best method to do so?
 
I usually use
if Nz(me.textbox,"")="" then

it covers both in 1 statement
 
And I use If Len(Me.TextBox & "") = 0 Then
 
your question was does it matter?

yes it does, because a null and a zero length string are not the same at all, and testing for one will not necessarily catch the other
the nz function enables you to deal with both cases simply

and i generally use

if Nz(me.textbox,vbnullstring)=vbnullstring then
 

Users who are viewing this thread

Back
Top Bottom