I have created a button on a form that I hope will export the output to a csv file. The underlying VBA within the Event procedure I am using is:
Private Sub Form_Click()
Option Compare Database
Private Sub export_Click()
On Error GoTo Err_export_Click
Dim AString As String
AString = "Export_Occupancy_"
DoCmd.TransferText acExportDelim, "", "ChildCare Vouchers For Accor", "\\uk.michaelpage.local\dfs\holdingsdata\nsac\Management Accounts\Paul Spencer" & AString & Format(date, "YYYY_MMDD") & Format(Time, "-HH_MM") & ".csv"
Exit_export_Click:
Exit Sub
Err_export_Click:
MsgBox Err.Description
Resume Exit_export_Click
End Sub
End Sub
ChildCare Vouchers For Accor - being the report I have selected from the Form.
Once I click the "Output To CSV" button on the form nothing seems to happen - output csv file to that directory.
Does anyone have any suggestions on what I may be doing wrong?
Thanks