ACCESS 2007 database compacting

Jacob Mathai

Registered User.
Local time
Today, 00:23
Joined
Sep 6, 2001
Messages
546
In ACCESS 2003, I was able to compact a live data base (single user) with a command button (using SENDKEYS command). ACCESS 2007 does not use sendkeys. Is there any way to compact an ACCESS 2007 using a command button on the Menu?
 
Would it not be better to use "Compact on Close" method. Rather than anything else? IMO using SendKeys was a bad idea too.
 
In ACCESS 2003, I was able to compact a live data base (single user) with a command button (using SENDKEYS command). ACCESS 2007 does not use sendkeys. Is there any way to compact an ACCESS 2007 using a command button on the Menu?

I can use sendkeys in 2007. You do have to have it in a trusted location to do so. Here's the code to do it in 2007:
http://www.btabdevelopment.com/main/CodeSnippets/CompactDatabase/tabid/122/Default.aspx
 
Try:

'Repairs and compacts DB
CommandBars("Menu Bar").Controls("Tools").Controls("Database utilities").Controls("Compact and repair database...").accDoDefaultAction
 
Thanks to all who responded. I was able to use Bob Larson's solution.
 

Users who are viewing this thread

Back
Top Bottom