Hello, my problem is that I am trying to export a query to a text file. I followed the procedure which worked when clicking the Run button and created a specification. When viewing the saved exports the specification is there. But when if try run the code in VBA I receive "The text file specification ' does not exist. You cannot import, export, or link using the specification." I have other specifications which work fine, these were imported when I upgraded from 2003.Note these don't show in the list of save exports.
It seem as if the specification is not being saved and assistance would be appreciated
ADDED CODE
#Private Sub Command507_Click()
On Error GoTo ProcError
Dim strPath As String
strPath = CurrentProject.Path
DoCmd.TransferText TransferType:=acExportDelim, _
SpecificationName:="ContactHome Source Specification", _
TableName:="qryPhoneSource6-1", _
FileName:=strPath & "\ContactHome.txt", _
HasFieldNames:=0
MsgBox "The selected Home Phone numbers have been exported " _
& "to the file ContactHome.txt" & vbCrLf _
& "in the folder:" & vbCrLf & strPath, vbInformation, _
"Export Complete..."
ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, , _
"Error in cmdExportTabDelim_Click event procedure..."
Resume ExitProc
End Sub#
Ypma
It seem as if the specification is not being saved and assistance would be appreciated
ADDED CODE
#Private Sub Command507_Click()
On Error GoTo ProcError
Dim strPath As String
strPath = CurrentProject.Path
DoCmd.TransferText TransferType:=acExportDelim, _
SpecificationName:="ContactHome Source Specification", _
TableName:="qryPhoneSource6-1", _
FileName:=strPath & "\ContactHome.txt", _
HasFieldNames:=0
MsgBox "The selected Home Phone numbers have been exported " _
& "to the file ContactHome.txt" & vbCrLf _
& "in the folder:" & vbCrLf & strPath, vbInformation, _
"Export Complete..."
ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, , _
"Error in cmdExportTabDelim_Click event procedure..."
Resume ExitProc
End Sub#
Ypma
Last edited: