Testing for Null fails

snowsride

Registered User.
Local time
Today, 16:52
Joined
Nov 29, 2001
Messages
33
I have a table where some of the values of MyField are null.

I am creating a function that depends on the value of Myfield which I pass to a variable varMyField and am testing it with If IsNull(varMyVariable) but it errors. Have tried setting the variable as a variant but no difference.

Function Test(varMyField as variant)

If isnull(varMyField) then
Dosomething,
Else
Dosomething Else
End if

End function

Any suggestions please?
 
If you test the field from a recordset
Code:
IsNull(rs("MyField"))

Is it not different when the variable is a string -
Code:
If varMyField = ""
 
Test for Null fails

Thanks for the reply. I made an error when dimensioning the variables!
 

Users who are viewing this thread

Back
Top Bottom