Opening an access app from within an access app

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

Guest

I have two access applications. Call 'em App1 and App2.

I would like to create a button on a form in App1 that will:
1) Close App1
2) Open App2

I'm sure the way somehow involves using a command similar to:
Access.Application.OpenCurrentDatabase ("C:\Local
Data\Testing\Application2.mdb")

but running this command tells me that "You already have the database open".

So how can I accomplish what I'm looking for?

Many thanks in advance,

Greg
 
I used this to restart an application using a different
workgroup. Where I have CodeDb.Name you would
put your MDB file name and full path. Chr(34) is a
double quote (")

If you are not using wrkgrp security you can remove the
wrkgrp and user name and password. In fact, you may
be able to just
shell("mypath\mymdb.mdb", vbMaximizedFocus).

(david)

sAccess = Chr(34) & SysCmd(acSysCmdAccessDir) & "msaccess.exe" & Chr(34)
sCmdLine = sAccess & " " & Chr(34) & CodeDb.Name & Chr(34)
sCmdLine = sCmdLine & " /wrkgrp " & Chr(34) & sWrkGrp & Chr(34)
sCmdLine = sCmdLine & " " & "/user myUser /pwd mypwd"

Call VBA.Shell(sCmdLine, vbMaximizedFocus)
DoCmd.Quit
 
Back
Top