Hi there guys
Basically, I have finished a mammoth sized database and I'm now thinking of what I can just bolt on to the end of it. I want to code a way to back up the database using VBA code; I've seen it done so I know it's possible.
I was going to put a button on the main switchboard to back up the database, but I spent ages designing it and I would mess up my perfect formatting. What I have done instead is change the coding of the Quit button so it is now like this:
Obviously source and destination are the paths of the actual database.
However, when this code is run, I get a run time error #70, permission denied.
What can I do to overcome this problem?
Many Thanks
Basically, I have finished a mammoth sized database and I'm now thinking of what I can just bolt on to the end of it. I want to code a way to back up the database using VBA code; I've seen it done so I know it's possible.
I was going to put a button on the main switchboard to back up the database, but I spent ages designing it and I would mess up my perfect formatting. What I have done instead is change the coding of the Quit button so it is now like this:
Code:
Private Sub btnQuitApplication_Click()
Dim msgBackup As Integer
msgBackup = MsgBox("Do you wish to back up the system first?", vbYesNoCancel + vbQuestion, "Back up first?")
If msgBackup = 7 Then
DoCmd.Quit
ElseIf msgBackup = 6 Then
FileCopy "source.mdb", "destination.mdb"
End If
End Sub
Obviously source and destination are the paths of the actual database.
However, when this code is run, I get a run time error #70, permission denied.
What can I do to overcome this problem?
Many Thanks