acCmdBackup - Command not available?

John Nelson

Registered User.
Local time
Today, 08:50
Joined
Jan 26, 2005
Messages
16
I'm trying to make a button to allow a user to back up the database. Though, when I click the button it gives me an error that says: "Command or action 'Backup' isn't available now."

The code is nothing fancy. I'm just not sure what I'm doing wrong.

Code:
Private Sub cmdBackup_Click()

DoCmd.RunCommand acCmdBackup

End Sub

Any help would be much appreciated. Thanks!
 
Ideally I wanted to allow the user to do the same thing as Tools>Database Utilities>Back Up Database. But it looks like what you've provided will do just fine. Thanks a lot for the help!
 
Ghudson, first of all... thanks for the reply. I appreciate your patience. I see now that there are a lot of similar posts around - obviously my search wasn't thorough enough. That aside, I've been playing with your code and it seems to work up until the Shell command goes looking for winzip. I'm running XP with Access 03. XP, as I'm sure you know, has a compression tool built-in.

Normally I'd just download winzip and be on my way, but this is going to be used in a multi-user network situation and I don't want to have to rely the user having another program to back up the db. So I'm wondering if you know how I could reference the built-in windows version of winzip. I wasn't able to track down an exe or something to use in place of "WinZip32.exe."

Thanks.
 
John Nelson said:
So I'm wondering if you know how I could reference the built-in Windows XP compression program [like WinZip]."
Your question has been asked before but I have yet to see or find an answer to make it work.

You could still use my function to backup the file just remove the zipping part of the code.
 

Users who are viewing this thread

Back
Top Bottom