Determine if an object variable is set

B

Brian

How can I determine if an object variable is Nothing.

Dim appMapPoint as Object
Set appMapPoint = CreateObject("MapPoint.Application")Set appMapPoint =
CreateObject("MapPoint.Application")

Later.... Set appMapPoint = Nothing

Here is why:

I am automating MapPoint via Access/VBA. I always set the map application
object to Nothing when I close it; however, I now need to block certain user
functions (like opening another map) if the instance of MapPoint is still
open. I thought perhaps I could check the state of the Object variable.

Like a dummy, I tried this: If appMpoint = Nothing Then

....of course, to no avail.
 
J

JimBurke via AccessMonster.com

I think the correct syntax would be

If appMapPoint Is Nothing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top