Compact and Repair Database

rohnds

Registered User.
Local time
Today, 00:39
Joined
Jul 20, 2010
Messages
19
In MS Access 2003 I used this code to compact and repair my database,

Public Sub CompactDB()

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

End Sub


But for some reason this doesn't work in MS Access 2007. That might be because MS Access 2007 does not have a Menu Bar.

How would I write the code to manipulate the menus in 2007 to compact and repair the database. This is a stand alone database.
 
You are correct since Access 2007 and newer uses a Ribbon instead of a menu bar.

Why not turn on the compact on close option?
 

Users who are viewing this thread

Back
Top Bottom