I've put "cleanup" buttons on some of my Access 2000 switchboards that delete temp tables, and I thought it would make sense to do a compact automagically right after that, but ...
DoCmd.RunCommand acCmdCompactDatabase
fails with the error message
"You can't compact the open database while running a macro or Visual Basic code."
So I tried just simulating the keystrokes:
SendKeys "%TDC", True
This works every-other time and fails with the same message on the alternate tries.
And it closes my switchboard when it does work.
No big deal, just another one of those little MS annoyances.
Any ideas? Thanks, DaveBo


Reply With Quote