If you want to compact the current database file manually, you can click
Tools -> Database Utilities -> Compact and Repair Database...
If you want to compact a different database, not the one currently open,
with VBA code, you can use the CompactDatabase method of the DBEngine
object. For that method, you must specify both the source database (the
one you want to compact) and the target database (the name of a new file
that the source database will be compacted into).
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.