Monday, July 21, 2008

Compact and Repair an Access Database using VBA

Below is some useful code to compact and repair the current Access Database using VBA:


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

No comments: