I am trying to open and access file from and Excel module. I have been able to get the coding in to get the access file to open but it won't stay open. I would also like to have it stay on top until the user clicks the "exit" command button. Here is the coding I have thus far can someone out there help me. I know the problem is in the last two lines of code. Thanks all.
Sub openDatabase()
Dim appAccess As Object
' Code to open the chosen file
Set appAccess = CreateObject("Access.Application"
appAccess.openCurrentDatabase "c:\my directory\myfilename.mdb"
appAccess.doCmd.openform "MainMenu"
appAccess.Visible = True
appAccess.Application.Quit acExit
Set appAccess = Nothing
End Sub
Sub openDatabase()
Dim appAccess As Object
' Code to open the chosen file
Set appAccess = CreateObject("Access.Application"
appAccess.openCurrentDatabase "c:\my directory\myfilename.mdb"
appAccess.doCmd.openform "MainMenu"
appAccess.Visible = True
appAccess.Application.Quit acExit
Set appAccess = Nothing
End Sub