Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / September 2005

Tip: Looking for answers? Try searching our database.

Checking if an object variable is set

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David C. Holley - 04 Sep 2005 05:07 GMT
Is there a way to test if an object variable is set? I have a SET
statement in an For Each loop and would like to check if the object
variable is SET

    For Each node In tvTargetControl.Nodes
        If node.Key = "06ACT:PrintPurchaseOrder" Then
            Set targetNode = node
            Debug.Print "nodes exist"
        Else
            Debug.Print node.Key
        End If
    Next
Alex Dybenko - 04 Sep 2005 07:00 GMT
Hi,
you can use:

If targetNode Is Nothing then
   'not set
else
   'set
end if

Signature

Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

> Is there a way to test if an object variable is set? I have a SET
> statement in an For Each loop and would like to check if the object
[quoted text clipped - 8 lines]
>         End If
>     Next
David C. Holley - 04 Sep 2005 15:02 GMT
Should have none I was trying IsNothing() duh

> Hi,
> you can use:
[quoted text clipped - 4 lines]
>     'set
> end if
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.