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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IsNull or Is Not Null... that is the question

Status
Not open for further replies.

cranebill

IS-IT--Management
Jan 4, 2002
1,113
US
Ok i can have a statement like this:

If IsNull(Variable) Then do something

How can i determine if variable is not null?

Bill
 
Bill,
You'll hate this....If Not IsNull(variable) then

It **IS** Monday.

Tranman
 
Hi Bill,

When you're stuck, there's always the really simple, if ugly ..

Code:
If IsNull(Variable) Then
Else
    ' Do your stuff
EndIf

But what you're looking for (and if your Shakespeare had been slightly better would have found [smile]) is ..

Code:
If Not IsNull(Variable) Then

Enjoy,
Tony
 
Funny thing is i actually tried IsNotNull lol

Thanx
 
Is there somewhere online where i can possibly find a list of commands like these?
 
It's not a matter of finding commands like If Not IsNull and If IsNull, but rather understanding what is going on. By consulting the documentation, you'll see that IsNull is a function, which returns a boolean value, that is True or False. The Not is a boolean operator (also described in the documentation), which toggles a boolean value.

So if the function IsNull returns True, then Not IsNull will perform a boolean operation (Not) against the function return, which in this case is Not True, or simply False.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top