Rename and move file to an existing folder

PISCES

Registered User.
Local time
Today, 14:29
Joined
Mar 11, 2004
Messages
12
Hi Group,
I have the following code:

newname= "H:\nob\" & left$(strFile,len(strFile)-4) & ".txt"

but what is returned for newname is the literal string.
I want the file to go to the H:\Nob folder which exists.

left$(strFile,len(strFile)-4) resolves to this 6310104.

So what I want is 6310104.txt in the H:\nob\ folder.

Kind Regards
 
Check out the Name Statement in the Access help files for more info and examples.

Code:
OldName = "C:\MYDIR\OLDFILE": NewName = "C:\YOURDIR\NEWFILE"
Name OldName As NewName	' Move and rename file.
 
That's handy! Thanks :)
 
SCORE!!!
THIS IS AWESOME!!!
Code:
OldName = "C:\MYDIR\OLDFILE": NewName = "C:\YOURDIR\NEWFILE"
Name OldName As NewName	' Move and rename file.
Works great and takes care of both of the issues I faced with renaming and moving the file!!! SWEET!
Thanks!
 
Last edited:

Users who are viewing this thread

Back
Top Bottom