Robert88
Robbie
- Local time
- Today, 13:19
- Joined
- Dec 18, 2004
- Messages
- 335
I have been trying to import a txt file into a table.
Doing it manually with import, using the Door Fob import specification and importing it into tblDoorFob table it is successful.
I have written VBA for a button on a form frmReadDoorFob.
Private Sub CmdReadFile_Click()
DoCmd.TransferText acImportDelim, "Door Fob", "tblDoorFob", "C:\Door_Fob\AutoArch(20040103-20040107).txt", False
' A message box indicating the process has completed.
MsgBox ("The file has completed its transfer")
End Sub
But when I use this VBA there is an error, it seems there is something wrong with the first field "fldDate". It reports in a table "AutoArch(20040103-20040107)_ImportErrors". In addition the tblDoorFob is filled with blank records.
I have attached in a zip the mdb and a sample of the txt file, which resided in a folder c:\Door_Fob.
I am unsure why this is not importing using VBA as it works when I manually import the data as seen in the tblDoorFob attached in the mdb file.
If anyone could help, I would appreciate it.
It is probably something simple I have over looked? I hope, as I have been banging my head against the wall with this one.
Robert88
Doing it manually with import, using the Door Fob import specification and importing it into tblDoorFob table it is successful.
I have written VBA for a button on a form frmReadDoorFob.
Private Sub CmdReadFile_Click()
DoCmd.TransferText acImportDelim, "Door Fob", "tblDoorFob", "C:\Door_Fob\AutoArch(20040103-20040107).txt", False
' A message box indicating the process has completed.
MsgBox ("The file has completed its transfer")
End Sub
But when I use this VBA there is an error, it seems there is something wrong with the first field "fldDate". It reports in a table "AutoArch(20040103-20040107)_ImportErrors". In addition the tblDoorFob is filled with blank records.
I have attached in a zip the mdb and a sample of the txt file, which resided in a folder c:\Door_Fob.
I am unsure why this is not importing using VBA as it works when I manually import the data as seen in the tblDoorFob attached in the mdb file.
If anyone could help, I would appreciate it.
It is probably something simple I have over looked? I hope, as I have been banging my head against the wall with this one.
Robert88