I am trying to open a database form from another database and this is the code I have to do that.
Dim appAccess As Access.Application
Dim strDB As String
strDB = "C:\Documents and Settings\dave\Desktop\Music Library.accdb"
Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase strDB
appAccess.Visible = True
appAccess.DoCmd.OpenForm "frmMain"
It works fine for the first second. I can see the database open and the form will be displayed, but less than a second later the database just closes. Is there some kind of code that I need to put in there to keep the database open?
Dim appAccess As Access.Application
Dim strDB As String
strDB = "C:\Documents and Settings\dave\Desktop\Music Library.accdb"
Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase strDB
appAccess.Visible = True
appAccess.DoCmd.OpenForm "frmMain"
It works fine for the first second. I can see the database open and the form will be displayed, but less than a second later the database just closes. Is there some kind of code that I need to put in there to keep the database open?