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 / July 2005

Tip: Looking for answers? Try searching our database.

reference to the right instance of Access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lauro - 27 Jul 2005 23:25 GMT
I need to get a reference to an already open instance of Access if it
is running or open it if not.

I'm using GetObject.

If no other instances of Access are open I have no problem. But I
have no guarantee to point to the rigth one if the user has already
opened one.

I found an half solution with a strange behavior:

Set oAccApp = GetObject(MyFileName, "Access.Application")
oAccApp.Visible = True

works fine (it open a new instance if it is not open or open and
"magically" merge it with the old one if already exists) if I don't
have a StartUp Form.

if I have a StartUp form, I tried to use:

Set oAccApp = GetObject(MyFileName, "Access.Application")
oAccApp.Visible = True
oAccApp.DoCmd.Close acForm, "Welcome Form"

But I get a run time error 2455 .

If I delete
oAccApp.Visible = True
I get multiple instances of my database.

Why?

Any Suggestions?

Thanks Lauro
david epsom dot com dot au - 29 Jul 2005 04:15 GMT
> If I delete
> oAccApp.Visible = True
> I get multiple instances of my database.

If it is not visible, it does not register itself
in the list of open objects. Don't know why.

> But I get a run time error 2455 .

   What's that?

(david)

>I need to get a reference to an already open instance of Access if it
> is running or open it if not.
[quoted text clipped - 31 lines]
>
> Thanks Lauro
 
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.