Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Evaluating a blank value 1

Status
Not open for further replies.

mdr2271

Programmer
Sep 14, 2005
42
US
I am assiging the variable varintdate to a field value from a recordset. I then evaluate it to see if it is blank or contains a value in an if then statement. However, when the value is blank or null it is not being evaluated properly. I have tried:

varintdate = ""
varintdate = null
trim(varintdate) = ""
trim(varintdate) = null

and none of them work.
 
If you combine a Null with a string, the result is always a string.

So you can do this:[tt]
MyValue = myRs("TheField") [highlight]& ""[/highlight]

If (MyVal = "") Then
'The field was null or empty
Else
'The field had some value
End if[/tt]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top