VBA & Macro Problems

How to Fix Access VBA Events Not Running After Copying a Database

Jason MillerJason Miller Nov 2, 2026 870 views

Question details

The user needs to restore VBA event procedures that fail to execute or reach breakpoints after copying an Access database to a new location.

How to Fix Access VBA Events Not Running After Copying a Database
Product
Microsoft Access
Device & OS
not provided
Scenario
Running an Access database after it has been copied or moved to a new folder, computer, or network drive.
Observed behavior
Standard Access macros continue to function, but VBA event procedures are blocked and do not trigger, even when event properties are correctly assigned.
Before you start

Verify that Windows has not blocked the copied file. Right-click the database file, select Properties, and check the 'Unblock' box at the bottom of the General tab if it is present.

Solution 1Recommended

Add the Database Folder to Trusted Locations

This is the primary solution for computer-level security restrictions that block VBA execution while allowing safe macros to run.

Microsoft Access restricts executing unsafe actions and VBA code from untrusted locations to protect against malicious scripts. When you copy a database to a new directory, it loses its trusted status. Moving the database folder into an Access Trusted Location permits the VBA event procedures to run without interference.

1
Open the Trust Center Settings

Launch Microsoft Access. Click on 'File' in the top-left corner, select 'Options', and then navigate to the 'Trust Center' tab. Click the 'Trust Center Settings' button.

2
Access Trusted Locations

In the left-hand menu of the Trust Center dialog, click on 'Trusted Locations' to view all currently trusted directories.

3
Add a New Location

Click the 'Add new location' button at the bottom. Browse to the specific folder where your newly copied database is stored.

4
Include Subfolders and Save

If applicable, check the box labeled 'Subfolders of this location are also trusted'. Click 'OK' on all dialog boxes to save your changes.

5
Restart the Database

Completely close the Access database and reopen it from the newly trusted location to test if the VBA event procedures are firing properly.

Add the Database Folder to Trusted Locations
Network Drives: If your database is stored on a network drive, ensure that the option 'Allow Trusted Locations on my network' is enabled in the Trusted Locations menu.
Free Microsoft Office alternative

Try WPS Office for Your Data and Macro Needs

While Microsoft Access is used for relational databases, many users rely on VBA macros and structured data tracking that can be managed efficiently with powerful spreadsheets. WPS Office is a lightweight, fully compatible suite that supports advanced data analysis and VBA macros in its Spreadsheet application at zero cost.

  1. 1. Download WPS Office: Visit the official WPS website to download the free installation package.
  2. 2. Install the Suite: Follow the simple on-screen instructions to install WPS Office on your computer in minutes.
  3. 3. Open Macro-Enabled Files: Launch WPS Spreadsheet and open your existing macro-enabled files to seamlessly continue your work with full VBA support.
Completely free, lightweight, and fast to installExcellent compatibility with Microsoft Office formats, including .xlsm and .xlsxBuilt-in support for running and editing VBA macros in spreadsheetsFamiliar user interface ensuring zero learning curve for Office users
microsoft office alternative - wps office

Frequently Asked Questions

Why do my Access macros still work when VBA is blocked?

Standard Access macros often use predefined 'safe actions' which are permitted by default security settings. However, VBA code is classified as an 'unsafe action' and will be entirely blocked by the Trust Center unless the file is placed in a designated Trusted Location.

How do I know if Windows has blocked my Access database file?

When you download or copy a database from another computer, Windows may add a 'Mark of the Web' to the file for security. Right-click the file, select Properties, and look at the bottom of the General tab. If you see a security warning with an 'Unblock' checkbox, the file is currently blocked by Windows.

Will compiling the database bypass the security restrictions?

No. Compiling the database resolves issues related to syntax errors and broken library references, which can independently stop code from running. However, if the Trust Center is blocking execution because the folder is not trusted, compiling the VBA project will not bypass that security requirement.