Constant for "Back Up Database?"

U

Undrline

I can manually go to Tools>Database Utilities>Back Up Database..., but this
doesn't work if I try to do the same thing with a button:

DoCmd.RunCommand acCmdBackup
Application.RunCommand acCmdBackup
RunCommand acCmdBackup
DoCmd.RunMacro (backup) 'Where "backup" is RunCommand Backup

None of the above work. I guess I must be using the wrong constant. What
should I be using? How can I find out what constants relate to what menu
items (it's not in the help file)?
 
U

Undrline

Found the answer for my own question:

'Application.RunCommand acCmdBackup
' The above code, though it should work, does not. This is a workaround.
CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database Utilities"). _
Controls("Back Up Database..."). _
accDoDefaultAction
 

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