jcaptchaos2
Well-known Member
- Joined
- Sep 24, 2002
- Messages
- 1,032
- Office Version
- 365
- Platform
- Windows
I posted this in the excel forum and probably should have posted it here,
I have this code that is very close but don't understand why the access database and form open and then close right away, looking for some advice.
I have this code that is very close but don't understand why the access database and form open and then close right away, looking for some advice.
Code:
Sub OpenAccess()
Dim LPath As String
Dim LCategoryID As Long
'Path to Access database
LPath = "N:\Fishbowl Databases\Labor Collection Min.accdb"
'Open Access and make visible
Set oApp = CreateObject("Access.Application")
oApp.Visible = True
'Open Access database as defined by LPath variable
oApp.OpenCurrentDatabase LPath
'Open form called CLOSECASTOPFRM
oApp.DoCmd.OpenForm "CLOSECASTOPFRM"
oApp.Visible = True
End Sub