Private Sub Form_Load()
If CreateObject("WScript.Shell").RegRead("HKEY_CURRENT_USER\Software\Microsoft\Office\" & Application.Version & "\Access\Security\" & IIf(Application.Version < 12, "Level", "VBAWarnings")) <> "1" Then
CreateObject("WScript.Shell").RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\" & Application.Version & "\Access\Security\" & IIf(Application.Version < 12, "Level", "VBAWarnings"), "1", "REG_DWORD"
End If
End Sub
طبعا هذا الكود يوضع فى النموذج الافتتاحى للبرنامج