Keep getting syntax error upon trying to run the following.
Any clue as to what I am missing?
Option Explicit
Option Compare Database
Private Sub TransferToExcel()
On Error GoTo Err_TransferToExcel
Dim query As String
Dim file As String
query = "qryFindAllEligDates"
file = "C:\Test\Adhoc\RptOct.xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, query, file, True
Exit_TransferToExcel():
Exit Sub
Err_ TransferToExcel():
MsgBox Err.Description
Resume Exit_TransferToExcel
End Sub
Any clue as to what I am missing?
Option Explicit
Option Compare Database
Private Sub TransferToExcel()
On Error GoTo Err_TransferToExcel
Dim query As String
Dim file As String
query = "qryFindAllEligDates"
file = "C:\Test\Adhoc\RptOct.xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, query, file, True
Exit_TransferToExcel():
Exit Sub
Err_ TransferToExcel():
MsgBox Err.Description
Resume Exit_TransferToExcel
End Sub