How can I use FileSystemObject in Access 2007 to confirm that a file has been copied sucessfully?
Posted on 2010-11-19
I have a command button in a MS Access 2007 Database that I use to copy a file. I want to confirm that the file has copied successfully, and I think FileSystemObject is the best way to do it. My command button executes the following line of code on after the On Click event:
FileCopy "C:\Folder1\Retirement.xlsx", "C:\Folder1\Retirement_Copy.xlsx"
After this line of code is run, I want to run a program that searches C:\Folder1 to validate that Retirement_Copy.xlsx exists. It it does exist, I'd like to have a message box that tells the user that the file copied successfully.
If it does NOT exist, I'd like a message box to inform the user that the file did not copy successfully.
Thanks. I'm getting better with VBA build in functions, but still have a long way to go.