TransferText Problems (1 Viewer)

Elvis

Registered User.
Local time
Today, 14:04
Joined
Sep 28, 2001
Messages
26
:confused: I am trying to transfer some text from a delimited text file into a table named "Audit". If I manually import the textfile everything works ok. I have coded a button to do the same thing without having to go through the whole manual thing, however it does not work. I changed the acImportDelim to acExportDelim, executed the button and the file gets exported, I then changed acExportDelim back to Import and ran again. I now get the following error message:

Field 'Field1' doesn't exist in destination table 'Audit.'

This is the command I have coded to perform the Import

DoCmd.TransferText acImportDelim, ,"Audit", "C:\documents and settings\temptxt\ukdev1_export.txt", False

Any help would be most appreciated
 

___

¯¯¯¯¯
Local time
Today, 14:04
Joined
Nov 27, 2003
Messages
595
When going through the import wizard, click on Advanced, here you can name your fields and save. Then place your saved import spec in the command line...
Code:
DoCmd.TransferText acImportDelim, "YourSavedImportSpec", "Audit", "C:\documents and settings\temptxt\ukdev1_export.txt", False
HTH
 

Users who are viewing this thread

Top Bottom