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

后端 未结 6 1281
孤独总比滥情好
孤独总比滥情好 2021-01-21 01:41

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,

6条回答
  •  心在旅途
    2021-01-21 02:20

    I don't know why people give suggestions that have not been tested yet. My solution is simple:

    If: [CurrentProject].[IsTrusted]=False RunMenuCommand: CloseDatabase

    Else

    If: [CurrentProject].[IsTrusted]=True RunCode: (you run the code or macro you wanted to in the first place here)

    This basically closes the database if the security warnings are coming on. If they are not, it opens just fine. The user that is the admin will need to decrease the macro security levels on the computer of whoever wants to access the database. This macro unlike others will actually run because it agrees with what Access wants.

    You're Welcome!

提交回复
热议问题