Access Junkie - MVP Alumnus - SDET XAS

Home
News
Access 2007 Inside Out
Online 2007 Training
Access 2007 FAQ
Access 2007 Help Articles
Technical Articles
Links
MSDN Articles
KB Articles
Blogs
Forums
Contact Us
About Us
Access 2007 FAQ

 

Why are my macros and VBA code not working in Access 2007?

 

Access 2007 by default disables all VBA code and certain macro actions from running when you open the database. This behavior is designed to protect you from any unsafe actions that could occur from using the database. You might be asking yourself, "Why do I need protection from a database I created?" Good question! This protection is more for the cases where you are opening a database created by someone else and/or an untrusted source.

 

For those of you who worked with Access 2003, you will no doubt remember the three security warning dialog messages that appeared every time you opened a database. In order to avoid that message you had to set your macro security level to low or create a digital certificate for the database. If you set the macro security level to low, Access applied this to every database.

 

The Microsoft Office development team has improved the security model in Access 2007. In this latest version, Access allows you to create Trusted Locations for better control of handling security concerns with databases. When you create a Trusted Location, Access trusts all content in any database you open within that location. No more confusing dialog boxes/message screens!

 

To set up a Trusted Location, follow these steps:

 

Click the Microsoft Office Button in the upper left corner of the application window.

 

Click the Access Options button on the Office menu, as seen in the following screenshot.

 

 

 

Click the Trust Center category on the left side of the Access Options dialog box.

 

Click the Trust Center Settings button as seen in the following screenshot.

 

 

 

The Trusted Locations area displays all currently saved trusted locations. To create a new location, click the Add New Location button, as seen in the following screenshot.

 

 

 

 

Click the Browse button and locate the folder you want to designate as trusted. Select the "Subfolders of this location are also trusted" check box if you want Access to trust any databases located within subfolders of that main directory. Enter an optional description you want for this folder, and click OK to save your changes, as seen in the following screenshot.

 

 

 

Access displays your new trusted location in the upper part of the dialog box. Click OK on the Trust Center dialog box and then click OK on the Access Options dialog box to return to the main application window.

 

If you need to remove a saved trusted location, follow the steps listed above until you come to the Trusted Locations area. Select the location in the upper part of the dialog box, and then click the Remove button.

 

 

There might be occasions where you want to temporarily trust the content in a specific database instead of saving the database in a trusted location. In these situations, Access 2007 allows you to temporarily enable all content within a database through the Message Bar. You'll see the Message Bar whenever you open a database that is not located within a Trusted Location. To temporarily enable the content, click the Options button on the Message Bar to open the Microsoft Office Security Options dialog box. Select the "Enable This Content" option and then click OK, as seen in the following screenshot. Access closes the database and then reopens the file to enable all content. Access does not display the Message Bar after it reopens the file, and all functions, code, and macros are now allowed to run in this specific database.

 

 

 

 

See more tips and tricks like this in our book: Microsoft Office Access 2007 Inside Out

 

 

Back to FAQ main page