Open one database from another

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to open one database and then open another one from it? What
I'm trying to accomplish is having a user open any database and during the
autoexec macro execution, open a 2nd database. Once the 2nd database is
closed, users would have access to the original database they selected. I'm
just starting to dip my toes into coding, so if the solution is too
complicated, I may have follow-up questions.

Thanks in advance for any suggestions!
 
Look at the OpenDatabase method in the Help file.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
Steve, I tried your suggestion, but it's telling me that there was an error
and Access cannot disply help. I've tried reinstalling it, but I'm still
getting the same message. Access displays help on other topics though.
 
If you already have a database, open a form to the code behind the form or
click on Modules and create a new module. In either case you need to be
where you can write some code. Now click on Help and look at the
opendatabase method.

Alternatively, create a new database, click on Modules and create a new
module. Now click on Help and look at the opendatabase method.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
Is there a way toopenonedatabaseand thenopenanother one from it? What
I'm trying to accomplish is having a useropenanydatabaseand during the
autoexec macro execution,opena 2nddatabase. Once the 2nddatabaseis
closed, users would have access to the originaldatabasethey selected. I'm
just starting to dip my toes into coding, so if the solution is too
complicated, I may have follow-up questions.

Thanks in advance for any suggestions!

You can use the Shell command like so.

Dim vAppID


vAppID = Shell("msaccess.exe " & sDesktopFolder & sAppFile,
vbNormalFocus)
AppActivate vAppID, True

Application.Quit

If you remove the quit line the database running the shell command
will remain open.
 
Back
Top