Using File>Backup

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I program Access 2003's File > Backup to either a button or as a
Switchboard item?
 
I tried that, I added a new Switchboard Item of Run Code > runcommand
acCmdBackup. When I click the switchboard item I get "There was an error
running commad."
I also had tried it as a VB statement and could quite figure it out.

Am I doing it wrong?
 
The syntax would be...
DoCmd.RunCommand acCmdbackup

However, here is an alternative.

Private Sub Back_up_Click()
CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Back Up Database..."). _
accDoDefaultAction
End Sub
 
Normally, all those lines would have to be on one line like

CommandBars("Menu Bar").Controls("Tools").Controls("Datab...

<space> <underscore> lets you put each part on a new line. Its
cleaner.
 
Back
Top