Simple problem I cant figure out

tmar89

Registered User.
Local time
Today, 17:20
Joined
Jun 16, 2003
Messages
30
I have a simple if statement to check if a string is Null or not but no matter what the value is, it always skips over the expression:

Do While Not rsEmail.EOF
If (rsEmail.Fields("email").Value) <> Null Then
strEmail = strEmail & rsEmail.Fields("email").Value & ";"
End If
rsEmail.MoveNext
Loop

strEmail = strEmail & rsEmail...... never executes even when the debugger is showing that the value is not Null. ideas?
 
nevermind.. I used <> "" instead and that worked. classic DUH moment
 
Additional Info

You should study the IsNull and IsEmpty functions. A field that has nothing in it is not necessary null, it made be empty. In Access null and empty are two distinct things. See the functions and their examples. To be really safe, design a function that checks for null and for empty and returns a boolean that lets you know for sure.
 
true.. i always forget about the IsNull function. Im so used to C that its just second nature to do if.. == Null thanks for the reminder!
 

Users who are viewing this thread

Back
Top Bottom