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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Backup current access file using vba while the file is open

Status
Not open for further replies.

jack1080

Programmer
Jun 2, 2007
34
MY
Backup current access file using vba while the file is open

I have a button in the form of the current access file. What I want to do is when the user click on the button,
triggered the vba to backup current access file. But since the file is currently open, is this possible? If yes, may I know how to do it with vba?

I have tried two methods but failed:
1) Use copytofile method, but I get permission denied due to file open;
2) Use dbengine.compactdatabase method, but it also has problem if the file is open.
 
You can use the FileSystemObject Object.
 
Thanks, that worked! I am wonder why filetocopy cannot work while filesysemobject able to do the job...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top