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 / Forms / October 2007

Tip: Looking for answers? Try searching our database.

Can VBA open a form in an already open database?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
billelev - 25 Oct 2007 22:01 GMT
I am able to use the OpenCurrentDatabse method to open a new instance
of an existing database and then open a form within that database.
However, if the database I am interested in is already open, is there
a way to open a form in the existing instance of that (already open)
database?

Thanks.

NB. The VBA code being executed exists in one database, and the form
in a different database.
Klatuu - 25 Oct 2007 22:35 GMT
If the database you are opening is not opened in exclusive mode, you should
be able to open it.  Are you having problems with it?
Signature

Dave Hargis, Microsoft Access MVP

> I am able to use the OpenCurrentDatabse method to open a new instance
> of an existing database and then open a form within that database.
[quoted text clipped - 6 lines]
> NB. The VBA code being executed exists in one database, and the form
> in a different database.
billelev - 26 Oct 2007 14:00 GMT
> If the database you are opening is not opened in exclusive mode, you should
> be able to open it.  Are you having problems with it?
[quoted text clipped - 11 lines]
> > NB. The VBA code being executed exists in one database, and the form
> > in a different database.

It's not that I can't open it, but rather that it is already open.
This is what I want to do:

1.  database1 - start database2 and open form1 (from vba in database1)
2.  database1 - close all forms, but keep database1 open
3.  database2 - after required actions, open database1 form1
4.  database2 - close

I can perform steps 1,2 and 4 but I do not know how to open a form in
database1 (when the database is already open) from vba in database2.
Klatuu - 26 Oct 2007 15:15 GMT
I have never done anything quite like that, so I am not sure how it would be
done.
Signature

Dave Hargis, Microsoft Access MVP

> > If the database you are opening is not opened in exclusive mode, you should
> > be able to open it.  Are you having problems with it?
[quoted text clipped - 22 lines]
> I can perform steps 1,2 and 4 but I do not know how to open a form in
> database1 (when the database is already open) from vba in database2.
billelev - 26 Oct 2007 15:27 GMT
It seems that the GetObject() function should allow you to reference
an existing instance of a database.  However, when I have tried it it
opens a new instance or generates an error.  It should be possible
once I figure out how to use GetObject().
 
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.