I have some code that creates an export file. I have included the code below. As you can see i have an export spec called Q_ExportToFileSpec. I have added a field to the query q_ExportToFile but when I go into the export spec and update the spec by adding a new field i get the following error:
Procedure Name:
Step: Checking version compatibility
Error Number: 3011
Error Description: The Microsoft Access database engine could not find the object 'Exported-Files.csv'. Make sure the object exists and that you spell its name and the path name correctly. If 'Exported-Files.csv' is not a local object, check your network connection or contact the server administrator.
Code:
On Error GoTo SubERR
DoCmd.SetWarnings False
spath = Environ("USERPROFILE") & "\Desktop"
DoCmd.TransferText acExportDelim, "Q_ExportToFileSpec", "q_ExportToFile", spath & "\Exported-Files.csv", True
MsgBox "Selected records have been exported to your desktop.", vbOKOnly, "File Exported"
DoCmd.OpenQuery "q_ArchiveRepairs"
DoCmd.OpenQuery "q_DeleteArchived"
DoCmd.SetWarnings True
SubEXIT:
On Error Resume Next
If Not rs Is Nothing Then
rs.Close
Set rs = Nothing
End If
Exit Sub
SubERR:
ErrorHandler
DoCmd.SetWarnings True
If gTesting Then
Stop
Resume Next
Else
GoTo SubEXIT
End If