Open a database with VBA

cargobay 69

Registered User.
Local time
Today, 08:36
Joined
May 1, 2001
Messages
25
I have two databases which store related data. I would like to open one database from the other using VBA (don't ask why). If possible, I would like the user to simply click a command button on a form in database 'A' which triggers database 'B' to open. The trick is I want database 'B' to open within a seperate Access shell so database 'A' is not effected or closed. Can this be done? Any suggestions how?

Thanks all
Darrin@CB69
 
You could try using a hyperlink, e.g.
Dim myDb as string
myDb = "C:\MyFolder\MyDatabase.mdb"
Application.FollowHyperlink myDb

Hope this helps
 
> Hi,
>
>
> One of the safest way I use: In the remote db, be sure Form1 has an event
> or some code, save the form. Make a standard module and add the
declaration:
>
> Dim xxx As Form_Form1
>
> and add the code
>
>
> Public Sub OpenForm1( )
> Set xxx=New Form_Form1
> xxx.Visible=True
> End Sub
>
>
> Save the module. Close that db. Open the first db, add the remote db in
the
> references (Tools | References... click the [Browse] button, etc). Next,
in
> the required place, just have
>


> NameOfTheOtherDb.NameOfTheStandardModule.OpenForm1
>HTH
Jeff

[This message has been edited by pcdummy (edited 07-23-2001).]
 

Users who are viewing this thread

Back
Top Bottom