I searched the forums and found some threads, but none of them were able to come up with a solution. I wanted to refresh the topic and see if someone has discovered a way.
I saw that link before, it does compact the database but it leaves it open. If I put a docmd.quit after that code I get an Access error saying I can't execute code (it starts compacting and then hits the quit command).
My main objective is when the user closes the database it will compact itself.
Tools - Options - General Tab. Check Compact on Close. If multiple users are sharing the same database, Access compacts the database when the last user closes it.
Alternatively, if you don't want all your users compacting on close (what if you have some users without administrative privileges - that could cause problems compacting) consider an admin tool like the Handy Access Launcher (
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.