Hide form controls until "Enable Content" button is pressed (1 Viewer)

cnstarz

Registered User.
Local time
Today, 09:34
Joined
Mar 7, 2013
Messages
89
In our enterprise environment, GPO forces all MS Office apps to disable macros by default until you click the "Enable Content" button in that yellow security message bar as soon as you open Access.

When my switchboard loads, I want to force users to click the "Enable Content" button before they can do anything.

What I have so far on Form_Load is if the current project isn't in a trusted location, then all controls on the form are invisible except for a text label that tells the user to click the "Enable Content" button:

Code:
Dim ctl As Control
Dim frm as Form

Set frm = Me

If CurrentProject.IsTrusted = True then
     frm.FormHeader.Visible = True
     For Each ctl In frm
          ctl.Visible = True
     Next
     Me.lblEnableContent.Visible = False
Else
     frm.FormHeader.Visible = False
     For Each ctl In frm
          ctl.Visible = False
     Next
     Me.lblEnableContent.Visible = True
End If
This is great if the database is in a non-trusted location. But in my instance, the bigger problem is that COM add-ins are force-disabled via GPO, so checking if the location is trusted won't do any good. Is there any way to programmatically check in VBA whether or not add-ins are enabled/disabled or if that yellow security bar is displayed at all?

Edit: As an added bonus, modifying the Registry is out of the question since users do not have admin rights to their boxes.
 

Users who are viewing this thread

Top Bottom