Working with External files

G

Guest

Using Access2003 I have a need to look into a directory, and one at a time,
rename and move each file there into another directory. The renaming and
moving I have an idea how to do, but how do I loop through the files in the
directory? There may be up to 10 files in the directory each with a
different name.

Thanks for any suggestions.
 
M

Marshall Barton

Eddy said:
Using Access2003 I have a need to look into a directory, and one at a time,
rename and move each file there into another directory. The renaming and
moving I have an idea how to do, but how do I loop through the files in the
directory? There may be up to 10 files in the directory each with a
different name.


Check the Dir function and Name statement in VBA Help.

You code might be something like this air code:

oldname = Dir(path\*.*)
Do Until oldname = ""
Name "path\" & oldname As "newpath\newname"
Loop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top