Hi Folks:
I would like to know what code I could add to the below code to make Access close if the report I'm exporting is NULL. The DailyQC report looks at a table called Daily_INV_Certs and exports it to a mapped drive as an Excel spreadsheet. If the table Daily_INV_Certs is empty I want Access to quit.
Thanks
Function testExport()
On Error GoTo testExport_Err
Dim strDate As String
Dim strFileName As String
Dim strFilePath As String
strDate = CStr(DatePart("m", Date) & DatePart("d", Date) & DatePart("yyyy", Date))
strFileName = "DailyCerts" & strDate & ".xls"
strFilePath = "T:\Pugh\" & strFileName
DoCmd.OutputTo acReport, "DailyQC", "MicrosoftExcel(*.xls)", strFilePath, False
testExport_Exit:
Exit Function
testExport_Err:
MsgBox Error$
Resume testExport_Exit
End Function
I would like to know what code I could add to the below code to make Access close if the report I'm exporting is NULL. The DailyQC report looks at a table called Daily_INV_Certs and exports it to a mapped drive as an Excel spreadsheet. If the table Daily_INV_Certs is empty I want Access to quit.
Thanks
Function testExport()
On Error GoTo testExport_Err
Dim strDate As String
Dim strFileName As String
Dim strFilePath As String
strDate = CStr(DatePart("m", Date) & DatePart("d", Date) & DatePart("yyyy", Date))
strFileName = "DailyCerts" & strDate & ".xls"
strFilePath = "T:\Pugh\" & strFileName
DoCmd.OutputTo acReport, "DailyQC", "MicrosoftExcel(*.xls)", strFilePath, False
testExport_Exit:
Exit Function
testExport_Err:
MsgBox Error$
Resume testExport_Exit
End Function