Automatically moving file after importing a csv file.
Posted on 2008-09-03
I've been working with importing a csv file into MS Access and all that is working beautifully. The last thing I need to do in this import is I want to move the file once it has been processed into a archive directory to clean it up nicely. This upload imports two csv files individually and again, I want it to be moved after import.
In terms of the specifics:
File Names: ImportRegistered.csv and ImportNotRegistered.csv
Initial location will be : C:\Upload\Data\Import (Both new files to be placed in this folder.)
After Import location of both files to move to will be: C:\Upload\Data\Archive
I should also ask if their a way to append the file name before moving it to archive too with say the date before or after the filename eg- ImportRegistered040908.csv or even 040908ImportRegistered.csv
If I don't do that, then the archive will probably overwrite the previous weeks file as the name would be the same.
As I have little idea of VBA, could you please help me with the code to:
1.Rename the file (if this is too complicated, I will leave this part!)
2. Move the files from the input to the archive directory.