importing several files at one time

ggreg

Registered User.
Local time
Today, 23:42
Joined
Aug 12, 2002
Messages
66
Is there a way to import several files at one time instead of
importing files one at a time.

Like could you set the names of the files to be imported
in a macros or modules click a button and then it would
import 10 files while you do something else?

if so whats the best way to do it?
 
Yes, you can automate the import of files. I do it by creating an array of file names in a module, stepping through the array to append the imported data to existing files.

The specific method used would depend on the type of files you're importing. In my app. they're DBF files. What are yours?
 
AncientOne,

They are csv files and I will have over a 100 to import
 
1) are the files all in one location?

2) Is this a one off operation or is it carried out at regular intervals?

3) What are you doing with the files after importing them?
 
AncientOne,
first thanks for your help.

I have found this line of code which is working well for me

DoCmd.TransferText acImportDelim, "file import specification", "tablename", "filename.csv"

found that due to WayneRyan post thanks WayneRyan.
his post help me to do a better search. to find how to
work with the line of code above.

WayneRyan and AncientOne, can you help me put
together an array of my csv file so I do not have to cut and
paste 200 file name

can I do something like:

arrayfile() = file
arrayfile()+1
*.csv



DoCmd.TransferText acImportDelim, "file import specification", "tablename", "' file '"

I have all my csv files in one folder
can you help me out with code to loop thru an array?
 
Last edited:
ggreg,

Don't need an array.

Code:
Dim FileName As String
Dim FolderName As String

FolderName = "C:\YourImports"

FileName = Dir(FolderName & "\*.csv")

While FileName <> ""
   DoCmd.TransferText acImportDelim, "file import specification", "tablename", FolderName & "\" & FileName
   FileName = Dir()
   Wend

Wayne
 
How to import?

Hi I'm a newbie here, I need help!! Pls help as I really do not know what tools to use..Do i need ODBC?...Thanks alot!

How to automate import of files?
1. Convert the log files to .csv files
2. Import .csv files as table & naming the last 2 numbers (date) as the filename?

There are 30.csv files.
Eg. For 1 file
Filename: WEBEXTD20040108.log change to
Tablename: 08

Thanks.
 

Users who are viewing this thread

Back
Top Bottom