Using CreateObject to run a 2nd instance of MSAccess

J

Jim Pockmire

The following code will open up a 2nd instance of MSAccess.

Dim oApp As Object
Set oApp = CreateObject("Access.Application")
oApp.Visible = True

1. How can I open a specified mdb after starting the 2nd instance?
2. What if I do not know the exact path to the mdb above, only that it
resides in the same folder as the mdb in the 1st instance?
 
V

Van T. Dinh

oApp.OpenCurrentDatabase ....

If you don't know the path except it is the same as the database in the
current instance of Access:

oApp.OpenCurrentDatabase CurrentProject.Path & "\" & {FileNameHere}...

(for A2K or later. For A97, slightly more complex but still can be done.)

See Access VB Help on OpenCurrentDatabase for other arguments.
 

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