Here's how to achieve this:
- Go to 'Database Tools'.
 - Select 'Compact and Repair Database'.
 - To compact the database each time it closes, click 'Options'.
 - Select 'Current Database'.
 - Check 'Compact on Close'.
 - Click 'OK' to apply changes.
 
Here's how to achieve this: