As a General answer to your question, see DoCmd.RunCommand in help.
However you cannot compact the current database in code as you are trying to do, for solutions to this particular requirement, search FAQ's and/or Google for "Compact Current database"
Regards
Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now -
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.