if file exists then rename file (date_1)

deekras

Registered User.
Local time
Today, 06:33
Joined
Jun 14, 2000
Messages
169
i have to export a few files a day. i would like to name them
filename_date_1
filename_date_2
filename_date_3
...

i want to check if the file name exists and if it does then change the number.
 
See Access Help for "dir" or "$dir".

There are good examples of checking for existence of a file name.

RichM
 
i have that part down. i can find if the filename exists. i need to know how to name the file
 
deekras will this do the trick?

Files

It is not a direct solution but if I understand you correctly that should get you started.
 
thanks.

but i don't think that really solves my problem. i don't do it all at one time.

i guess what i am looking for is the most recent file name. then i'd read the name to find the number and then determine the new name.

i can read the name to find the number and i can determine the new name. i just need to know how to find the most recent file name.
 
When you say, "change the number" do you mean you want to have your files exported as:

filename_date_3
filename_date_4
filename_date_5

etc...

because files 1,2, and 3 already exist?

Or that you want to rename the pre-existing files on disk that have already been exported?
 
I think you might have misunderstood the question. Is it the first case that I mentioned or the second case?

In other words, do you want to change the names of the files that you will be exporting or the names of the existing files on disk?
 
new files. every day, i import info, work with it and then export the new files. i could have up to 5 files a day.
 

Users who are viewing this thread

Back
Top Bottom