M
Mike Hinde
Wondering if anyone can offer suggestions for overcoming a
problem the code below is currently giving me?
It's a simple little code to switch between 2 databases
that appears to work fine (and indeed DOES work fine
switching between 3 out of 5 databases) but when you start
using forms in the newly opened database, clicking on
forms/running certain bits of code causes Access to close
down for no apparant reason.
All databases work fine when opened individually - only
when opened using this code do the problems occur.
Any ideas as to what is going wrong/what I've done wrong
would be most appreciated??
*****************************************************
Private Sub Box8_Click()
Const strConPathToEMS = "C:\database.mdb"
Dim appAccess As Access.Application
'Open another Access and the required database
Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase strConPathToEMS
appAccess.Visible = True
appAccess.RunCommand acCmdAppMaximize
appAccess.DoCmd.OpenForm "frmSwitchboard"
appAccess.Forms("frmSwitchboard").SetFocus
'Close calling database
DoCmd.Close acForm, Me.Name, acSaveNo
DoCmd.Quit
End Sub
***************************************************
problem the code below is currently giving me?
It's a simple little code to switch between 2 databases
that appears to work fine (and indeed DOES work fine
switching between 3 out of 5 databases) but when you start
using forms in the newly opened database, clicking on
forms/running certain bits of code causes Access to close
down for no apparant reason.
All databases work fine when opened individually - only
when opened using this code do the problems occur.
Any ideas as to what is going wrong/what I've done wrong
would be most appreciated??
*****************************************************
Private Sub Box8_Click()
Const strConPathToEMS = "C:\database.mdb"
Dim appAccess As Access.Application
'Open another Access and the required database
Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase strConPathToEMS
appAccess.Visible = True
appAccess.RunCommand acCmdAppMaximize
appAccess.DoCmd.OpenForm "frmSwitchboard"
appAccess.Forms("frmSwitchboard").SetFocus
'Close calling database
DoCmd.Close acForm, Me.Name, acSaveNo
DoCmd.Quit
End Sub
***************************************************