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.
AutoExec
So I really ask how to do this:
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”
Conditions: [CurrentProject].[IsTrusted]=False
Line two: Conditions: [CurrentProject].[IsTrusted]=Trueand now open the "start menu form"
Conditions: [CurrentProject].[IsTrusted]=True
And it's all!
, , ....
( "" ). .
, , ( " " ), , . , , .
, 100, :
Private Sub Form_Timer() DoCmd.Close acForm, "Information" DoCmd.OpenForm "start menu" End Sub
- .
"notEnabled" " " , , , , " ".
on load VBA, , , "notEnabled".
, , , , , , . SOON, , on-load , , .
, , , .
, IsTrusted TRUE AutoExec. . Access 2007 - IsTrusted , .
, , . :
: [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!
Source: https://habr.com/ru/post/1724813/More articles:can property / synthesize sqlite3 * database object? - sqlite'zip' in Erlang - erlangclear text box after form submit - javascriptJQuery class selector starting with? - jqueryКак заставить компилятор Java рассказать мне, какой тип он имеет? - java.net - .netPerforming histogram alignment processing using C ++ opencv - c ++Сообщение об ошибке "Неверные значения в структуре SQLDA" с Firebird и Delphi 2009 - delphiZEND controllers - how to trigger an action from another controller - zend-frameworkHow bad is it to mimic IDENTITY / AUTOINCREMENT columns using triggers in Oracle? - oracleAll Articles