By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,940 Members | 611 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,940 IT Pros & Developers. It's quick & easy.

Compact And Repair Database

P: 8
Can I make an macro to do COMPACT AND REPAIR DATABASE, automatic?
thanks.
Dec 24 '07 #1
Share this Question
Share on Google+
1 Reply


zachster17
P: 30
Can I make an macro to do COMPACT AND REPAIR DATABASE, automatic?
thanks.
I did a Google search and found that you can do it through VBA code:

Expand|Select|Wrap|Line Numbers
  1. Public Sub CompactDB() 
  2.     CommandBars("Menu Bar").Controls("Tools").Controls("Database utilities").Controls("Compact and repair database...").accDoDefaultAction 
  3. End Sub 
  4.  
Another website says that is has to be the only code in a procedure and has to be called from the end of another procedure...I don't know if that's true or not though.

Zach
Dec 24 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.