[AccessD] A2003:Rename a file in a folder

paul.hartland at fsmail.net paul.hartland at fsmail.net
Tue Oct 24 09:06:54 CDT 2006


Darren,

Off the tope of my head use the following:

Dim strFile As String

strFile = Dir(myCoolCSVfile.csv, vbHidden) ' Put the full path before the filename
If (strFile<>"" ) then
     Name myCoolCSVfile.csv As YYMMDDHHMMSS.csv    ' Put the full path before the filename and new file name
Endif

' Your routine to put the new file into C:\MyCoolFolder

Paul Hartland



Message Received: Oct 24 2006, 02:58 PM
From: "Darren DICK" 
To: "'Access Developers discussion and problem solving'" 
Cc: 
Subject: [AccessD] A2003:Rename a file in a folder

Hi all

I have a file that will be always named the same - EG myCoolCSVfile.csv

It will be dumped into a folder...say C:\MyCoolFolder at random times

I need some code to Check the C:\myCoolFolder to see if the file
myCoolCSVfile.csv file exists in the folder - and if it does to rename it to
YYMMDDHHMMSS.csv

Where YY = Year MM = Month DD = Day etc etc

Does anyone have anything that might suit?

Many thanks in advance

Darren
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





Paul Hartland 
paul.hartland at fsmail.net 
07730 523179


More information about the AccessD mailing list