A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Can VBA open a form in an already open database?



 
 
Thread Tools Display Modes
  #1  
Old October 25th, 2007, 10:01 PM posted to microsoft.public.access.forms
billelev
external usenet poster
 
Posts: 3
Default Can VBA open a form in an already open database?

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.

  #2  
Old October 25th, 2007, 10:35 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Can VBA open a form in an already open database?

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?
--
Dave Hargis, Microsoft Access MVP


"billelev" wrote:

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.


  #3  
Old October 26th, 2007, 02:00 PM posted to microsoft.public.access.forms
billelev
external usenet poster
 
Posts: 3
Default Can VBA open a form in an already open database?

On Oct 25, 5:35 pm, Klatuu wrote:
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?
--
Dave Hargis, Microsoft Access MVP

"billelev" wrote:
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.


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.

  #4  
Old October 26th, 2007, 03:15 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Can VBA open a form in an already open database?

I have never done anything quite like that, so I am not sure how it would be
done.
--
Dave Hargis, Microsoft Access MVP


"billelev" wrote:

On Oct 25, 5:35 pm, Klatuu wrote:
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?
--
Dave Hargis, Microsoft Access MVP

"billelev" wrote:
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.


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.


  #5  
Old October 26th, 2007, 03:27 PM posted to microsoft.public.access.forms
billelev
external usenet poster
 
Posts: 3
Default Can VBA open a form in an already open database?

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().

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.