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.
Public Sub CompactDB()
CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction
End Sub
|