The basic rule is:
"You cannot compact the open database by running a macro or Visual Basic code.
Instead of using a macro or code, dick the File tab and then dick Compact and Repair Database."
I found by searching by the title above:
"This is truth, but this is not whole truth ;-) Following VBA code compacts
current database:
CommandBars.FindControl(id:=2071).accDoDefaultActi on
Krzysztof Pozorek [MVP], Dec 20, 2007"
My problem is how to implement this. I tried using a button to execute this code but it is of course the code was within Visual Basic and I got the basic rule message.
Any idea how he accomplished it or was that only working in 2007?