Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with .MoveFile command

Status
Not open for further replies.

batteam

Programmer
Sep 12, 2003
374
US
I am attempting to move some .csv files from one folder to another using the following:

fs.MoveFile "X:\File Name\subfolder\ & txtFilename1", "X:\xxx\xxx\"

where 'txtFilename1' references a text box on my form that contains the actual file name. The value of 'txtFilename1' is something like: "06073122_export.csv". My problem is that my .MoveFile command gives a "File Not Found" error when I substitute "txtFileName1" in my command instead of the actual file name. When I use the actual file name in my command, all works OK.

Must I use the actual file name in the .MoveFile command or can't I reference it like my example? Is it just a syntax problem? I tried a few different configurations but have no luck.

Thanks for any help.
 
I think your quotes are in the wrong place - try this:
fs.MoveFile "X:\File Name\subfolder\" & txtFilename1 & ", X:\xxx\xxx\"



I have great faith in fools; self-confidence my friends call it.
-Poe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top