How to Compact and Repair a DB within a Macro ?

T

Thomas

Hi All,

Could somebody tell me how to compact and repair a db within a macro with
Access 2003 ?

Thanks & Regards,

Thomas
 
T

Thomas

Hi Steve,

Thanks for your answer but when I try to do it, I receive the message:

"You can't compact the open database while running a macro or Visual Basic
code.
Instead of using a macro or code, on the tools menu, point to Database
Utilities, and then click Compact/Repair Database."

How can I avoid this message and run the compact from the macro ?

Best regards,

Thomas
 
Top