How to force user to deal with the Security Warning when starting Access 2007?

Johan picture Johan · Dec 5, 2009 · Viewed 8.6k times · Source

When a user start an Access 2007 database that have macros and vba, a security warning is shown. I want the user to deal with this warning, so if the the content is't enabled, the user should not be able to use the database.

Now I use a macro named AutoExec (opens a form that works like a menu), and that macro is run before the user deal with the security warning. But I want to check if the content is enabled and if not I will show a form that inform the user that they should enable the content.

So what I'm actually asking for is how do I do this:

  1. If vba and macros is not enabled -> show form "information"
  2. If vba and macros is enabled -> show form "start menu"

Answer

Johan picture Johan · Dec 13, 2009

Ok, after a while I have the solution. Thanks for the answers who led me the right way.

This article from Microsoft is very helpful.

In the AutoExec-macro, I have two lines:

Line one: Conditions: [CurrentProject].[IsTrusted]=False and then I choose witch Form I want to open and in this case it is the "info about security warning form"

Line two: Conditions: [CurrentProject].[IsTrusted]=True and now open the "start menu form"

And that's all!