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

馋奶兔 提交于 2019-12-01 21:54:32

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!

If the content is disabled, then you cannot check, since your code cannot run....

You might like to consider a start-up form ("information"). This will show without macros.

In addition, you can run some start-up code or a macro that closes the information form and opens the main form ("start menu"), if macros are disallowed, this will not run. However, I think you may get an unsightly warning.

EDIT

Set the timer interval to say, 100 and add a little code to Information form:

Private Sub Form_Timer()
   DoCmd.Close acForm, "Information"
   DoCmd.OpenForm "start menu"    
End Sub

Just to add my solution -- I was just dealing with this issue.

By default, in database options have it set to open with form "notEnabled" On this "not enabled" form, have some text, pictures, or what have you that lets the user know that he/she needs to 'enable content'.

In the on load event for this form, just put some VBA to open the actual form you want the user to be presented and close the "notEnabled" form.

This way, if the user opens the database without making it trusted, enabling content, they are stuck on the form that tells them how to do that. As SOON as it's trusted, the on-load event of the form will fire and redirect the user to whichever form you want, with content enabled.

If the user opens the database and already has trusted the file, they don't see the form telling them to make it trusted.

You can avoid this by setting the IsTrusted flag to TRUE in your AutoExec macro. See Transitioning Your Existing Access Applications to Access 2007 -- search for IsTrusted to get you to the heart of the explanation of how to handle it.

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!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!