Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to Import a number of txt files using *.txt

Status
Not open for further replies.

Daz

Technical User
Nov 19, 2000
13
GB
Hi,

I have been trying forever (or so it seems) to try to import txt files in a directory by using wildcard. Can this be done?

I have to create a txt file with a different file name eg:

darrell.txt
jane.txt

if i create a txt file one after the other i just overwrites the first. it has to be separate because each file is for one customer only.

When i use the wildcard in the import code it says it cant find the file *.txt

this is the import code:

DoCmd.TransferText acImportDelim, "Main_Hirer", "Main_Hirer_Tbl", "C:\TestExport\*.txt"

All Help Welcomed

Darrell...




 
You need to set this up to use a loop with the DIR function.

There have been several threads on this topic, so a search through the various (or all) forums using the keyword "DIR" should provide sufficient information for you to at least get started.



MichaelRed
mred@duvallgroup.com
There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top