splasho...@yahoo.com wrote:
Hi I have searched and found lots of stuff and played with some but
couldnt get anything to even remotely work. I have a directory with
multiple .csv files i would like to import them all into a
corresponding table. Names run seqentially from cell01 - cellx but
may not all be present. It would not be an issue if an empty table was
created as i could manually sort that but a pointer in the right
direction would be great.
Glyn Rowling
You could use the BrowseFolder API
(
http://www.mvps.org/access/api/api0002.htm) to prompt the user for a
folder. If you want the system to remember it, you could stuff the
value into a table or into a custom property. then on to the looping
through files. use the Dir function. I know there are examples here
somewhere... I think either Albert Kallal or Brendan Reynolds posted it
a few years ago... (maybe 2000, I don't remember anymore...)
but the basic plan is this:
1. use BrowseFolder API to specify the path you want.
2. store (or not) the path you just chose.
3. use the DIR function to loop over the files in a folder
4. and process each file individually. (moving processed files
elsewhere?)
Albert K has code somewhere for a progress meter, I think... then you
could
(between 2 and 3) get a count of all files in the directory to process
process file (showing filename somewhere...)
update progress meter.
I just like that with processes that take a long time so I know things
are still working. Otherwise, people figure something's wrong because
it takes so long and give your working app the three-finger salute and
kill it.