I have a line of code that I'm trying to use to back up my backend database.
If I attach that code to a command button, it works great. If I attach it to the Form_Open event of a form, it works great. If I put it in a function and call it from a macro, it works great, too.
But if I set a Switchboard option to call the function, open the form, or run the macro, I get an error: Run time error 70. Permission Denied.
I can't seem to find anything about this in the forums. I know it's because the backend is in use at the time, because if I change the code to copy some other random file instead of the backend, it works fine.
So what can I do to free up the backend so that the function works from the Switchboard?
Code:
FileCopy CurrentProject.path & "\Tracking_be.mdb", CurrentProject.path & "\Backup\Tracking_be_backup.mdb"
If I attach that code to a command button, it works great. If I attach it to the Form_Open event of a form, it works great. If I put it in a function and call it from a macro, it works great, too.
But if I set a Switchboard option to call the function, open the form, or run the macro, I get an error: Run time error 70. Permission Denied.
I can't seem to find anything about this in the forums. I know it's because the backend is in use at the time, because if I change the code to copy some other random file instead of the backend, it works fine.
So what can I do to free up the backend so that the function works from the Switchboard?