Skip to main content

Access Junkie - MVP Alumnus

Access Inside Out Books
Access 2010 FAQ
Access 2007 Training
Access 2007 FAQ
Access 2007 KB Articles
Technical Articles
MSDN Articles
Contact Us
About Us
Member Login
Access 2010 FAQ


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


Access 2010 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 coming straight from 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 and Access 2010. In this latest version, Access allows you to create Trusted Locations and Trusted Documents 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. If you designate a database as a Trusted Document, Access enables all content in the database whenever you open the file. No more confusing dialog boxes/message screens!


To set up a Trusted Location, follow these steps:


Click the File tab on the Backstage view.


Click the Options button on the left side of the Backstage view, 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.


In Access 2010, you can also designate a specific database as a Trusted Document. When you open a database, Access displays a Security Warning in the Message Bar. Click the Enable Content button, as seen below, to enable the content of the database and mark the database as a Trusted Document. If you keep the database in the same location, Access enables the content each time you open the file.



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 or designating the database as a trusted document. In these situations, Access 2010 allows you to temporarily enable all content within a database through the Backstage view. Click the File tab on the Backstage view. On the Info tab, you'll see the Security Warning information. Click the Enable Content button to see two options, as shown below. If you click Enable All Content, Access marks the document as a Trusted Document.



To temporarily enable the content, click Advanced Options to open the Microsoft Office Security Options dialog box. Select "Enable content for this session" 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. The next time you open the database, however, Access disables the content.



See more tips and tricks like this in my book: Microsoft Access 2010 Inside Out



Back to FAQ main page