Verify variable is not null

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using Access 2000. How can I varify that a variable is not null with an
IF statement? Seems like the following code would work but ISNOTNULL isn't
the opposite of ISNULL. What is?

If ISNOTNULL(Variable1) then
'Do my thing
Endif
 
Hi, Del,

Try it this way:

If Not Isnull(Variable1) then
'Do Your thing
End If

You were close but not quite :>)

--
HTH

Mr B
email if needed to:
draccess at askdoctoraccess dot com
 
I am using Access 2000. How can I varify that a variable is not null with an
IF statement? Seems like the following code would work but ISNOTNULL isn't
the opposite of ISNULL. What is?

If ISNOTNULL(Variable1) then
'Do my thing
Endif

There is no such Access thing as ISNOTNULL (1 word).

There is IS NOT NULL (3 words in SQL) as well as NOT ISNULL (2 words
in Access and VBA).

So you could use.. to check for Null as well as a zero length string:

If Not IsNull(Variable1) or Variable1 = "" Then ...
 
Back
Top