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.
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.