How to Automatically Back Up an Access Database When Closing
Question details
The user needs a method to configure Microsoft Access to automatically save a backup copy of a database to a selected folder when the application is closed.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Implementing an automated backup routine triggered by closing a split database in Microsoft Access to prevent data loss.
- Observed behavior
- A copy of the back-end database is automatically saved to a designated backup folder via a script every time the user closes the Microsoft Access application.
Verify that your Access database is split into a front-end and a back-end, and ensure you have created a dedicated backup folder on a secure drive.
Use a VBA FileCopy Operation on a Split Database
This method utilizes a simple Visual Basic for Applications (VBA) script triggered when the database closes to copy the back-end data file to a safe location.
This automated backup approach works best with a split database. It targets the back-end file (which stores all your critical tables and data) rather than the front-end interface. If your database is not yet split, you must split it before implementing this code to avoid file lock issues.
If you are using a single-file database, go to the 'Database Tools' tab on the ribbon and click 'Access Database' in the Move Data group to split it into front-end and back-end files.
Press ALT + F11 to launch the Visual Basic for Applications editor within your front-end Access database.
Locate the main hidden startup form of your database. In the form's 'On Close' or 'Unload' event, insert a FileCopy script that specifies the source path of your back-end database and the destination path of your backup folder.
Save your VBA code and close the Access database. Navigate to your selected backup folder to confirm that a fresh copy of the back-end database has been successfully created.

Looking for a Lightweight, Reliable Office Suite?
While Microsoft Access is highly specialized for complex database management, WPS Office is the perfect free and lightweight alternative for your everyday document processing, spreadsheet analysis, and presentation tasks. It offers a familiar interface and seamless format compatibility to boost your productivity without the heavy resource footprint.
- 1. Download the installer: Visit the official WPS website and download the free installer for your operating system.
- 2. Install WPS Office: Run the setup file and follow the on-screen instructions to complete the lightweight installation process.
- 3. Open and edit your files: Launch WPS Office to immediately start creating, editing, and safely saving your Office documents with built-in backup protection.

Frequently Asked Questions
What is the difference between backing up a front-end and a split database back-end?
In a split database, the front-end contains the application's user interface (forms, reports, queries, and VBA code), while the back-end contains the actual data tables. Backing up the back-end ensures your core data is safe and updated, which is the most critical component to protect.
Can I automatically back up an unsplit Access database upon closing?
It is generally not recommended to automatically back up an unsplit database while closing, as it can cause file locking errors or data corruption. Splitting the database first allows the front-end to safely trigger the copy of the independent back-end file.
Where should I store my automated Access database backups?
To maximize data safety, configure your FileCopy script to save the backup to an external hard drive, a secure network-attached storage (NAS) location, or a folder that automatically syncs to a secure cloud service.




