Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Sep 2004
    Location
    Canyon Lake, Texas, USA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access Backup utility not available in VB code (Access 2003)

    I am trying to use a command button on a form to enable a user to bring up the backup utility you get from the menubar under the "File" item. Thus on the event click in VBA code:

    Application.RunCommand AccmdBackup
    (or DoCmd.RunCommand 513, 513 being the number for the backup item)

    I get "Run-time error 2046: The command or action "Backup" isn't available now."

    I've looked all over and can't find a solution to this problem. If you know of one, please pass it on to me.

    I've done a workaround using the DOS copy command in a one-line batch file "copy %1 %2" and using Shell(file.bat sourcefile destinationfile), but I'm afraid in the future there will be no DOS commands available in Windows and would like to get the Access command to work right. (The sourcefile and destinationfile are selected by the user by way if an inputbox).

    Any help appreciated,

    Jim Gansle

  2. #2
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Backup utility not available in VB code (Access 2003)


  3. #3
    New Lounger
    Join Date
    Sep 2004
    Location
    Canyon Lake, Texas, USA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Backup utility not available in VB code (Access 2003)

    Thanks so much for replying, Dave. I had seen that article before but didn't think it applied to my situation because it talked of the problem in the context of automation (which doesn't apply to the application I'm working with) and specifically addressed different commands than I was concerned with. Actually, I tried something like the first workaround provided in the article (putting the focus on the database window before invoking the backup command), but no go. But after I got your message I decided to try both workarounds in the article. Unfortunately both still resulted in the same old error message.

    Jim Gansle

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •