Automation: Open Another DB

cheftim

Registered User.
Local time
Today, 07:33
Joined
Jan 22, 2007
Messages
33
Hey folks -

Is there a way to open a different data base from within another?

I would love to have a command button that closes the current database and opens a second. (My project is growing and it would make things much easier if the next several sections would be on their own - esspecially since they are unrelated to the main portion of the project).

Many thanks for your input,

t
 
Try the following, by substituting the Db path as required
Call Shell("C:\Program Files\Microsoft Office\Office\msaccess.exe X:\YourDatabase.mdb", vbNormalFocus)
Application.Quit acQuitSaveNone
 
It Works!

Thank you so much! This will make things go so much easier. I made some modifications for Access 2007 by changing "Office" to "Office12" and changing the extention to "accdb". I was unable to get it to work with my original location (perhaps because there were spaces in the name of the folder?) but I was able to move the new db to the server and use it there.

I will now be able to make smaller databases as "Modules" instead of running the huge one all the time. This should speed things up and make my life much easier. Thanks again!



Call Shell("C:\Program Files\Microsoft Office\Office12\msaccess.exe \\D1hlwg21\reservations\Employees.accdb", vbNormalFocus)
Application.Quit acQuitSaveNone
 

Users who are viewing this thread

Back
Top Bottom