backing up a database

J

JT

I'm using the code below to back up the database when a user pushes a button.
It works fine when they provide a file name once the dialog box pops up.

vDB = ActiveWorkbook.Sheets("Files").Range("E6")
Set AppAcc = New Access.Application 'Opens Access or gets reference to app
already running
AppAcc.OpenCurrentDatabase vDB
DoCmd.SetWarnings False
AppAcc.CommandBars("Menu Bar").Controls("Tools").Controls("Database
utilities"). _Controls("Back Up database...").accDoDefaultAction
DoCmd.SetWarnings True
AppAcc.Quit acQuitSaveNone
Set AppAcc = Nothing

I would like to modify it in 2 ways:

First, I would like the file name to be blank when the "Save As" dialog box
opens. It now displays the last file name.

Secondly, I would like to program an message, so that if the user clicks
"cancel" in the "Save As" dialong box, it will say the "database not backed
up".

I having trouble doing both of these things with the code I am using. Any
suggestions would be greatly appreciated.
 

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

Similar Threads


Top