Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / November 2006

Tip: Looking for answers? Try searching our database.

Allow User to Compact and Backup DB

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Manuel - 26 Nov 2006 22:21 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.