Why????

lcross

Registered User.
Local time
Yesterday, 21:32
Joined
Aug 30, 2005
Messages
39
I'm trying to do a simple if then
i'm using a value of a text box to the if like:
if textbox.value is null then
blablabla
else
blablabla
end if
but it
the textbox is empty but i gives me the error of invalid use of null.
i've tryed with "" or 0 but nothing works, always the same error.
WHY??????????????
PS: the textbox isn't getting values from nowere but i date formated, i use this many times and it works fine, is because the field is date formated?
 
Do not forget about the empty strings.

If IsNull(Me.MyTextBox) or Me.MyTextBox = "" Then
 
or just use

If Me.MyTextBox & "" = "" Then

as this performs a check for empty string and null at the same time. Found it on this forum, with logic behind it going like this:

If you concatenate (use &) a null string with "", you get "". If you concatenate "" with "" you get "". If you concantenate any other string with "" you get the string you started with.
 

Users who are viewing this thread

Back
Top Bottom