Hi, Paul.
This backup command is for backing up "another" database file, not the
current one. Apparently, it's for backing up an MSDE database back end, not
a Jet front end. Please see the following Web page for a mention of this
using VBA code:
http://groups.google.com/group/micr...public.access.*&rnum=9&hl=en#9a45b66ad105bd8d
Is there an autobackup function somewhere that will do it for me?
No. Probably because it's not safe to back up an Access database file while
it's open. However you could try the following code, and if you have the
correct version of Access, then not only will it create a backup file for
you, Access won't crash afterwards. To use this code, create a button on a
form and name it BackUpDBBtn, then paste the following code into the form's
module, then save and compile the code. Save all of your work in this
database now. Open the form in Form View and select the BackUpDBBtn button.
Watch out for word wrap:
Private Sub BackUpDBBtn_Click()
On Error GoTo ErrHandler
CommandBars("Menu Bar").Controls("Tools"). _
Controls("Database utilities").Controls("Back up database..."). _
accDoDefaultAction
Exit Sub
ErrHandler:
MsgBox "Error in BackUpDBBtn_Click( ) in" & vbCrLf & _
Me.Name & " form." & vbCrLf & vbCrLf & _
"Error #" & Err.Number & vbCrLf & vbCrLf & Err.Description
Err.Clear
End Sub ' BackUpDBBtn_Click( )
HTH.
Gunny
See
http://www.QBuilt.com for all your database needs.
See
http://www.Access.QBuilt.com for Microsoft Access tips.
(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.