Whats wrong with the script below. I keep getting a compile error:
expected: End of Statement
'------------------------------------------------------------
' Test_Locks_macro
'
'------------------------------------------------------------
' autoexec1
'
'------------------------------------------------------------
Function autoexec1()
On Error GoTo autoexec1_Err
SetWarnings = False
Dim sNow As String
Dim sPath As String
sNow = Format(Now(), "mmddyyyy-hhmmss")
sPath = "Y:\0001 Secondary Marketing Reports"
SendKeys "y", False
DoCmd.OutputTo acOutputReport, "LOCKS - Detail", acFormatRTF, sPath & "Y:\0001 Secondary Marketing Reports\14 - Lock Summary.rtf" & "_" & sNow & ".rtf", False
DoCmd.SetWarnings True
autoexec1_Exit:
Exit Function
autoexec1_Err:
MsgBox Error$
Resume autoexec1_Exit
End Function
expected: End of Statement
'------------------------------------------------------------
' Test_Locks_macro
'
'------------------------------------------------------------
' autoexec1
'
'------------------------------------------------------------
Function autoexec1()
On Error GoTo autoexec1_Err
SetWarnings = False
Dim sNow As String
Dim sPath As String
sNow = Format(Now(), "mmddyyyy-hhmmss")
sPath = "Y:\0001 Secondary Marketing Reports"
SendKeys "y", False
DoCmd.OutputTo acOutputReport, "LOCKS - Detail", acFormatRTF, sPath & "Y:\0001 Secondary Marketing Reports\14 - Lock Summary.rtf" & "_" & sNow & ".rtf", False
DoCmd.SetWarnings True
autoexec1_Exit:
Exit Function
autoexec1_Err:
MsgBox Error$
Resume autoexec1_Exit
End Function