Testing whether object = nothing 
Author Message
 Testing whether object = nothing

Is there a better way to check whether an object is set to nothing?

Something like if myObject = nothing then

At the moment I'm doing this:
    Dim objActiveForm As Object

    Set objActiveForm = getActiveForm
On Error GoTo OpenForm
    If Left(objActiveForm.Name, 6) = "frmSub" Then
        Unload objActiveForm
    End If
OpenForm:
    frmSubInvoice.Show

I would like to check if the object is set to something first.

Any ideas?

Francois



Sun, 06 Nov 2005 15:19:13 GMT  
 Testing whether object = nothing

Quote:
> Is there a better way to check whether an object is set to nothing?

> Something like if myObject = nothing then

If myObject Is Nothing Then

--
Reply to bob_butler Chr$(64) cox Chr$(46) net
De gustibus non disputandum



Tue, 08 Nov 2005 10:46:27 GMT  
 Testing whether object = nothing
Quote:
> De gustibus non disputandum

Who?!

--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep it in the groups.

Quote:


> > Is there a better way to check whether an object is set to nothing?

> > Something like if myObject = nothing then

> If myObject Is Nothing Then

> --
> Reply to bob_butler Chr$(64) cox Chr$(46) net
> De gustibus non disputandum



Thu, 17 Nov 2005 13:38:13 GMT  
 Testing whether object = nothing
loosely, ""there is no disputing taste"


Quote:
> > De gustibus non disputandum
> Who?!

> --
> Ken Halter - MS-MVP-VB - http://www.vbsight.com
> Please keep it in the groups.




> > > Is there a better way to check whether an object is set to nothing?

> > > Something like if myObject = nothing then

> > If myObject Is Nothing Then

> > --
> > Reply to bob_butler Chr$(64) cox Chr$(46) net
> > De gustibus non disputandum



Thu, 15 Dec 2005 01:58:47 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How can I get whether Object variable is nothing (=nothing) or not

2. Detecting whether an object reference points to nothing or to a valid object

3. Testing nothing objects

4. How to test if an object equals nothing

5. Testing for object set to Nothing - Please help!

6. How to test if an object equals nothing

7. Testing an Object equal to Nothing

8. Test see if object = nothing

9. Test object for "Nothing"

10. Object = Nothing type test...

11. How to test is an object = NOTHING

12. How to test if object is Nothing?

 

 
Powered by phpBB® Forum Software