Testing Null value?

pdbowling

Registered User.
Local time
Today, 06:17
Joined
Feb 14, 2003
Messages
179
Hi all.

I have a query that returns lots of data.
I assign the recordset fields to variables.

Some of the fields come back null (some date fields).

I need to know which ones are null so I can assign something to them.

I tried this.

if myDateVariable is null then
do this code
end if

it gives me an 'Object Required' error

I tried

if myDateVariable = null then
do this code
end if

This skips the if statement even though I clearly see the variable is null when I test it at the stop point just before this line.

I even tried

if myDateVariable is empty then
but that failed as well.

What should I be doing?
Thanks everyone.
PB
 
have you tried

Code:
If IsNull(myDateVariable) Then
do something here
End If


Andy
 
The Nz() function is useful also for assigning a specific value.

i.e.

Code:
If Nz(myValue, "bla") = "bla" Then
 

Users who are viewing this thread

Back
Top Bottom