Also, it looks like you are NOT using the "theFilePath" in the DoCmd command, only "filename1".
Here are options:
Code:
Private Sub Export_Products_Click()
Dim filename1 As String
Dim theFilePath As String
filename1 = "Products Export" & "_" & Format(Date, "dd-mm-yyyy") & ".csv"
theFilePath = "C:\Users\Damian\Desktop\Work\Zimmerman"
DoCmd.OutputTo acOutputQuery, "Products Export", acFormatTXT, theFilePath & "\" & filename1, False
End Sub
Code:
Private Sub Export_Products_Click()
Dim filename1 As String
Dim theFilePath As String
filename1 = "Products Export" & "_" & Format(Date, "dd-mm-yyyy") & ".csv"
theFilePath = "C:\Users\Damian\Desktop\Work\Zimmerman\" '<<-- added backslash
DoCmd.OutputTo acOutputQuery, "Products Export", acFormatTXT, theFilePath & filename1, False
End Sub
Code:
Private Sub Export_Products_Click()
Dim filename1 As String
Dim theFilePath As String
filename1 = "Products Export" & "_" & Format(Date, "dd-mm-yyyy") & ".csv"
theFilePath = "C:\Users\Damian\Desktop\Work\Zimmerman\" & filename1 '<<-- added backslash and filename1
DoCmd.OutputTo acOutputQuery, "Products Export", acFormatTXT, theFilePath, False
End Sub