Using Switchboard to open another Access file/program

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

Guest

Really simple thing, I can't seem to get 1 Access app to open another.

' Dim oAccess As New Access.Application
Call Application.OpenCurrentDatabase("c:\temp\temp.mdb")
'Call oAccess.OpenCurrentDatabase("c:\temp\temp.mdb")
'oAccess.Visible = True

When trying things like the above, the closest I get is the called app flash
up and disappear. Or it never appears.. it's just plain weird. I don't care
if I have to have the current app closed to get to the other one.. rather
have both open, but any way to get the other one up would be nice.

Access 2000
 
Define oAccess at the form level... not in the routine itself.

Dim oAccess As Access.Application

Private Sub Command3_Click()
strdb = "path\db1.mdb"
Set oAccess = CreateObject("Access.Application")
oAccess.OpenCurrentDatabase strdb
oAccess.Visible = True
End Sub
 
on 03/01/05 said:
Dim oAccess As Access.Application
Private Sub Command3_Click()
strdb = "path\db1.mdb"
Set oAccess = CreateObject("Access.Application")
oAccess.OpenCurrentDatabase strdb
oAccess.Visible = True
End Sub

I am using the above method under a Quit Button to
open an Access backup application in which the user can
manage backups on the database which he just closed.
So we have:

Private Sub QuitButton_Click()
strdb = "path\backup.mdb"
Set oAccess = CreateObject("Access.Application")
oAccess.OpenCurrentDatabase strdb 'open the backup ap
oAccess.Visible = True
Application.Quit 'close the database ap
End Sub

However, users sometimes close from the Access X button
or the Access window menu. Then they don't get the Backup
application. The above method does not work in the Close,
Unload or Deactivate events of the swithboard form.
Any way to make it work?
 
Back
Top