How to display message if macros are disabled?

ppataki

Registered User.
Local time
Today, 00:09
Joined
Sep 5, 2008
Messages
267
Dear All,

I would like to know how I can make Access 2007 display a message if I open a database that contains macros but in the Trust Center macros are disabled

I know that Access automatically displays a warning bar when doing so, but that is no good to me, I would need a msgbox that appears if macros are disabled (so that other parts (forms, etc) don't get displayed)

Many thanks in advance :)
 
In Access 2007 and Access 2010 you can check the status of CurrentProject.IsTrusted using an AutoExec macro (or perhaps in the Load/Open of a startup form). If it's not trusted, then display a message or perhaps a macro-only simple form explaining what the user must do.

For a working example, download and open the Northwind 2007 sample database from a non-trusted location to see how this works:

http://office.microsoft.com/en-us/templates/northwind-2007-TC001228997.aspx?pid=CT101428651033

--------------------
Jeff Conrad - Access Junkie - MVP Alumnus
SDET II - Access Test Team - Microsoft Corporation

Author - Microsoft Access 2010 Inside Out
Co-author - Microsoft Office Access 2007 Inside Out
Access 2007/2010 Info: http://www.AccessJunkie.com

----------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.mspx
----------
 
Thank you, it works very well!!
:)
 
You're welcome, glad to help.
Good luck with your project.

--------------------
Jeff Conrad - Access Junkie - MVP Alumnus
SDET II - Access Test Team - Microsoft Corporation

Author - Microsoft Access 2010 Inside Out
Co-author - Microsoft Office Access 2007 Inside Out
Access 2007/2010 Info: http://www.AccessJunkie.com

----------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.mspx
----------
 

Users who are viewing this thread

Back
Top Bottom