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

Testing for Nothing

Status
Not open for further replies.

robF

Programmer
Dec 15, 2000
8
0
0
US
How do I test to see if an object has been set to Nothing?
 
You need to use the syntax

If obj is nothing then
'stuff
endif

Using the equal sign in the If statement won't work.

To assign an object to nothing, use set:

set obj = nothing.

Hope this helps.
 
one thing to keep in mind, if an object variable is defined with the
Code:
Dim SomeObj As New ObjectName
syntax rather than the
Code:
Dime SomeObj As ObjectName
syntax checking to see if it is nothing will result in an instance of the object being created if it is nothing. Ruairi

Could your manufacturing facility benefit from real time process monitoring? Would you like your employees to be able to see up to the minute goal and actual production?
For innovative, low cost solutions check out my website.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top