files / back-up database

  • Thread starter Thread starter mark kubicki
  • Start date Start date
M

mark kubicki

what would be the code to assign the commmand:
"file / back-up data base..."
to a command button on a user form (assumng the usual default values that
are part of the standard toolbar command?)

thanks in advance,
mark
 
Hi Mark,
There is no way to invoke the File/Back Up Database from code since the code
is stored in the database that is being backed up. You could use the
DoCmd.CopyDatabaseFile method, but all windows except the main database
window must be closed first. I reccommend using the CopyFileA API call (See
http://www.pcreview.co.uk/forums/thread-1068342.php for an example) or the
Scripting.FileSystemObject method (See
http://www.accessvba.com/forum/archive/index.php/t-10745.html for an example).

I hope this helps.
 
Back
Top