eed
11-17-2006, 10:48 AM
Hi, all,
I have a tab-delimited text file of records that were exported from Reference Manager. I want to create an automated process to import these records into an existing Access table.
When I use the the Import Text wizard via the File>Import menu command, everything works fine, there are no errors, and I get exactly what I want, without providing any additional details beyond the filename and table name (well, and the fact that the text file is tab-delimited).
However, when I use the TransferText method (in a Macro or in VBA, either one), the process fails and I get an error message stating that "Field 'F1' doesn't exist in the destination table."
There are no field headings or anything included in the text file: just field values and tabs. I can't figure out where Access is coming up with this alleged "Field 'F1.'" Neither the text file nor the database even contain the value 'F1,' in any context! Below is the VBA I have tried to use (strFile is a variable containing the filepath to be imported; it is set by the user's selection in a FileOpen dialog box):
DoCmd.TransferText acImportDelim, , "IMPORT_TEMPLATE", strFile, False
Does anyone have any insights into why I might be receiving this error and how I can get the same beautiful results of the menu command through an automated procedure? Much appreciation for any help!!!
~ eed
I have a tab-delimited text file of records that were exported from Reference Manager. I want to create an automated process to import these records into an existing Access table.
When I use the the Import Text wizard via the File>Import menu command, everything works fine, there are no errors, and I get exactly what I want, without providing any additional details beyond the filename and table name (well, and the fact that the text file is tab-delimited).
However, when I use the TransferText method (in a Macro or in VBA, either one), the process fails and I get an error message stating that "Field 'F1' doesn't exist in the destination table."
There are no field headings or anything included in the text file: just field values and tabs. I can't figure out where Access is coming up with this alleged "Field 'F1.'" Neither the text file nor the database even contain the value 'F1,' in any context! Below is the VBA I have tried to use (strFile is a variable containing the filepath to be imported; it is set by the user's selection in a FileOpen dialog box):
DoCmd.TransferText acImportDelim, , "IMPORT_TEMPLATE", strFile, False
Does anyone have any insights into why I might be receiving this error and how I can get the same beautiful results of the menu command through an automated procedure? Much appreciation for any help!!!
~ eed