Compact & Repair

  • Thread starter Thread starter S Jackson
  • Start date Start date
S

S Jackson

I want to add a button to my switchboard so that allows the user to Compact
and Repair the Database without having to click Tools, etc.

I wrote a little macro (mcrCompactDB), but when I attempt to run it I get a
message saying I cannot compact the database while running a macro or VB.

Anyway to overcome this little problem or will I just have to forget this
idea?

TIA
S. Jackson
 
I found the code on this NG web site and I have this in my database too. BTW
I call the function from a macro and it works fine.

Public Function CompactDatabase()

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

End Function

HTH

Mark.
 
Mark

Thank you so much for offering the code. It works beautifully. I call the
code from my switchboard.

Thank you again.

S. Jackson
 
Back
Top