Help with TransferText importspec

saharlan

Registered User.
Local time
Today, 10:48
Joined
Jan 9, 2003
Messages
13
I am attaching a simple mdb I am creating to read in a bunch of txt files with no delimeters.

1) I created an import spec called "VartecImportSpec"
2) I can manually file/import my text file go to advanced and select my import specification & save the data to my tblVartecImport with no problem.

The Problem:
When I try loop through the files with the import spec, only the first column populates and I get file import errors. The Import error files look as if the import spec file wasnt loaded properly.

Help would be appreciated.
 

Attachments

Hi Saharlan,

One line in your code needs changing (shown red);

Old Code;

Code:
DoCmd.TransferText [COLOR="Red"]acImportDelimited[/COLOR], "VartecImportSpec", "tblVartecImport", strFolderPath & objF1.Name, False

New Code;

Code:
DoCmd.TransferText [COLOR="red"]acImportFixed[/COLOR], "VartecImportSpec", "tblVartecImport", strFolderPath & objF1.Name, False

That is a cool trick with your *.txt going to the archive folder after it is has read it, I like it. :D

Hope this helps. :p

Robert88
 
Last edited:

Users who are viewing this thread

Back
Top Bottom