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

 

Is it possible to write code or use a macro to open the Access Options dialog box in Access 2007?

 

Yes, this is certainly possible. If you'd like to use a macro to open the Access Options dialog box, you'll need to select the RunCommand action in the Action column. If you can't see the RunCommand option in the drop-down list of actions, please see the following page for assistance with that: Related Topic

 

After you select RunCommand in the Action column, you'll see one argument called Command at the bottom of the Macro Design window. Select Options from the drop down list of commands. Your macro should now look like this: 

 

 

 

Close and save your new macro and then test it out. You'll notice there is an exclamation point in the left column of this macro action. This means that Access won't run this macro unless you have enabled the content this database and/or put the database in a trusted location. To learn more about enabling content and trusted locations, please see the following page: Related Topic

 

If you'd like to programmitically open the Access Options dialog box, use the following line of code:

 

DoCmd.RunCommand acCmdOptions

 

You could put this code behind the Click event of a command button or in a public module, as the following screenshot illustrates.

 

 

As just mentioned, you'll need to enable the content in this database and/or place the database in a trusted location in order for Access to execute this code.

 

 

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

 

 

Back to FAQ main page