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
tina - 26 Nov 2006 23:11 GMT
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
> Hi,
>
[quoted text clipped - 6 lines]
> Thanks!
> Manuel
David - 27 Nov 2006 18:31 GMT
Roger's Access Library also has a sample database to show how to do this.
http://www.rogersaccesslibrary.com/download3.asp?SampleName=CompactBackEndDB.mdb
> Hi,
>
[quoted text clipped - 6 lines]
> Thanks!
> Manuel