You have to build an ImportSpec for text files manually (once) before you
can use code like this.
Step through the import wizard all the way to the final screen and do NOT
hit Finish.
Instead click Advanced and Save As...
Give the spec a name and write it down.
What you wrote goes in the code as ImportSpecName.
Also, check out TransferText in Help.
Kill will delete your files.
Do NOT use it unless you have backups!
(Or that is the behavior you expect.)
--
Joe Fallon
Access MVP
Mark said:
Joe,
This seems to be exactly what I need but am really new to programming and
can't get it to work. I have created a command button and have pasted the
code into the on click event. The only parts in the code I have changed are:
ChDir (C:\MyFiles") to point to where the files to import are stored.
I have changed the AccessTableName to the name of the table I want the data to go to.
From the same line I have changed the "c:\MyFiles\" to the directory of
where the file are and done the same on the KIll line.