|
-
March 26th, 2001, 10:34 PM
#1
Easy Q :Null String
If txt1.text = Null then
'do something
elseif txt1.text <> Null then
'do another thing
end if
I can't check for the null string.
-
March 27th, 2001, 12:30 AM
#2
Re: Easy Q :Null String
if text1.text = "" then
'do something
else:
' do something else
end if
This?
Phil
-
March 27th, 2001, 12:30 AM
#3
Re: Easy Q :Null String
Try this instead:
if txt1.text = "" Then
'do something
else
'do something else
end if
--Joey
-
March 27th, 2001, 02:15 AM
#4
Re: Easy Q :Null String
First of all, a textbox can't contain null. it contains a nullstring "" or vbNullString (<-- this last one actually is faster then the use of "").
If you do have a value that can contain Null and you want to test for it, you need to use the IsNull Function. Null doesn't mean empty, it's more like 'i don't know'. For this reason Null isn't equal to Null. Try the following and you will see what I mean.
If null = null then
msgbox "null = null"
else
msgbox "null <> null"
End If
If IsNull(null) then
msgbox "null is null"
else
msgbox "null is Not null"
End If
Tom Cannaerts
[email protected]
The best way to escape a problem, is to solve it.
-
March 27th, 2001, 05:21 AM
#5
Re: Easy Q :Null String
Cakkie, thank you for helping me to solve this problem !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|