HelloWorldGuy
MIS
I am beyond confused. When I do a manual import of this data into a new table I have no serious issues. Only when I use transfer text I get numerous erros and a mostly blank table. I am using the saved import specification of the manual import. Also, I am clearing out the table with VBA to do a clean import.
Code:
Private Sub cmdImportData_Click()
Dim MyFile, MyDir, MoveCmd
Dim FileCount As Integer
CurrentProject.Connection.Execute "delete * from tblSN137"
MyFile = "C:\Users\Import.txt"
FileCount = 0
If MyFile = "" Then
MsgBox ("No Files Found")
Else
FileCount = FileCount + 1
MsgBox ("Your file is being imported...")
DoCmd.TransferText acImportFixed, "MyImportSpecification", "tblMyTable", MyFile, False, ""
DoCmd.SetWarnings False
End If
MsgBox ("The SN137 Table has been updated")
DoCmd.Close acTable, "tblSN137"
DoCmd.SetWarnings True
End Sub