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.
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.