How do I get a user to deal with a security warning when starting Access 2007?

When a user starts the Access 2007 database with macros and vba, a security warning is displayed. I want the user to deal with this warning, so if the content is not included, the user should not use the database.

Now I use a macro with the name AutoExec(opens a form that works like a menu), and this macro runs before the user cope with the security warning. But I want to check if the content is included, and if not, I will show a form that informs the user that they should include the content.

So I really ask how to do this:

  • If vba and macros are not included → show "info" form
  • If vba and macros are enabled → show the "Start menu" form
+3
source share
6 answers

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

This Microsoft article is very helpful.

In the AutoExec macro, I have two lines:

Line one: Conditions: [CurrentProject].[IsTrusted]=Falseand then I select the “I” form that I want to open, in which case it’s “information about the security warning form”

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

And it's all!

+6

, , ....

+1

( "" ). .

, , ( " " ), , . , , .

, 100, :

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

- .

"notEnabled" " " , , , , " ".

on load VBA, , , "notEnabled".

, , , , , , . SOON, , on-load , , .

, , , .

+1

, IsTrusted TRUE AutoExec. . Access 2007 - IsTrusted , .

0

, , . :

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

Else

: [CurrentProject]. [IsTrusted] = True RunCode: ( , )

This basically closes the database if security warnings continue. If it is not, it opens just fine. The user who is the administrator will need to reduce the macro protection levels on the computer of the person who wants to access the database. This macro, unlike others, will be executed because it agrees that it wants access.

Welcome!

-1
source

Source: https://habr.com/ru/post/1724813/


All Articles