Allow User to Compact and Backup DB

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I want to provide the user with the ability to Compact the database and also
to Back it up, via a button on a form - in my database all standard Access
menus and tool bars are diactivated.

Any suggestions?

Thanks!
Manuel
 
well, you don't mention what version of Access you're using. the following
code runs on an A2000 database, running in Access 2003. i'm not sure if it
will run in Access 2000 or not. you can paste the code into a public module,
as

Public Function isBackup()

Dim str As String
str = "Back Up Database..."

CommandBars("Menu Bar").Controls("Tools").Controls("Database
Utilities").Controls(str).accDoDefaultAction

End Function

note the entire command, which begins with "CommandBars(..." must be on one
line in the database, not line-wrapped as it is here in the newsreader. you
can call the function directly from the button's OnClick event property line
in the Properties box in form Design view, as

=isBackup()

hth
 

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


Back
Top