I got this one from 101 ready to use macros. When I run it, it shows an instantaneous flash of the form, but then the form shuts down. Any suggestions?
Sub Macro95()
'Step 1: Declare your variables
Dim AC As Access.Application
'Step 2: Start Access and open the target database
Set AC = New Access.Application
AC.OpenCurrentDatabase _
("C:\Temp\Database171.accdb")
'Step 3: Open the target form and make Access visible
With AC
.DoCmd.OpenForm "DatabaseForm", acNormal
.Visible = True
End With
End Sub
Sub Macro95()
'Step 1: Declare your variables
Dim AC As Access.Application
'Step 2: Start Access and open the target database
Set AC = New Access.Application
AC.OpenCurrentDatabase _
("C:\Temp\Database171.accdb")
'Step 3: Open the target form and make Access visible
With AC
.DoCmd.OpenForm "DatabaseForm", acNormal
.Visible = True
End With
End Sub
Last edited: