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

Testing Object for Nothing

Status
Not open for further replies.

RSfromCO

Programmer
May 3, 2002
149
US
I have an object objMyObject. If the object has been instantiated then I want the application to do one thing, if the object has not been instantiated I want the application to do something else.

Is there a way to find out if the object has not been instantiated (other than through error handling)....

Such as...

If objMyObject = Nothing Then...

or...

If IsNull(objMyObject) Then ....

I tried both of these things and VBA doesn't like trying to compare an object with Nothing, and the IsNull always seems to return FALSE.
 
Never mind. I figured it out....

If (objMyObject is nothing) Then ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top