Home  |   French  |   About  |   Search  | mvps.org  

What's New
Table Of Contents
Credits
Netiquette
10 Commandments 
Bugs
Tables
Queries
Forms
Reports
Modules
APIs
Strings
Date/Time
General
Downloads
Resources
Search
Feedback
mvps.org

In Memoriam

Terms of Use


VB Petition

General: Compact Current Database

Author(s)
Juan M. Afan de Ribera
For Access 2000 and Access 2003. Here is a snippet of code for compacting the current database. It uses the accDoDefaultAction method, that performs the
specified object's default action, and can be run from a command button on a form.

accDoDefaultAction is a method of the hidden IAccessible Class in Office library.

'   ***** Code Start *****
Public Sub CompactDB()

   CommandBars("Menu Bar"). _
   Controls("Tools"). _
   Controls("Database utilities"). _
   Controls("Compact and repair database..."). _
   accDoDefaultAction

End Sub
'   ***** Code End  *****

© 1998-2010, Dev Ashish & Arvin Meyer, All rights reserved. Optimized for Microsoft Internet Explorer