backup on close

M

mhmaid

hi
on my main form i have two buttons : one to backup , the other to exit. but
i want to keep both codes in one
like this
Private Sub EXIT_Click()

If MsgBox("Quitting Database.." _
& vbCrLf & "Are you sure you want to Quit?" _
, vbYesNo, "Warning !!") = vbYes Then

CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Back Up Database..."). _
accDoDefaultAction


DoCmd.Quit

End If


End Sub


but i am getting a message saying you cannot exit database now.what should i
add to code to solve this ?
thank you.
actually , on the end of each working day, i backup my db twice , one copy i
keep on my computer in the same folder with db, the other i save it to a
flash memory.
so i wonder if this also can be added to the code to achieve these two steps .
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top