Here is code I use for a menu item that only appears for DB users identified as "Superusers".
Note the Allow/Disallow Bypass setting requires creation of that Database property first. The code is in Access help.
Public Function EaseStartup()
With CurrentDb
.Properties("AppTitle") = "SMHC Client Maintenance SUPERUSER"
.Properties("StartUpShowDBWindow") = True
.Properties("AllowShortcutMenus") = True
.Properties("AllowFullMenus") = True
.Properties("AllowBuiltInToolbars") = True
.Properties("AllowToolbarChanges") = True
.Properties("AllowSpecialKeys") = True
.Properties("AllowBypassKey") = True
Application.SetHiddenAttribute acTable, "sec_User_Security", False
Application.SetHiddenAttribute acTable, "sec_Object_Security", False
'.Properties("Auto Compact") = False
'AppIcon
'StartUpForm
End With
MsgBox "Startup settings are set for development. " & vbCrLf & _
"The Application will now close.", vbCritical, _
"Development Settings!"
Application.Quit
End Function
Public Function RestrictStartup()
With CurrentDb
.Properties("AppTitle") = "SMHC Client Maintenance"
.Properties("StartUpShowDBWindow") = False
.Properties("AllowShortcutMenus") = True
.Properties("AllowFullMenus") = False
.Properties("AllowBuiltInToolbars") = True
.Properties("AllowToolbarChanges") = False
.Properties("AllowSpecialKeys") = False
.Properties("AllowBypassKey") = False
Application.SetHiddenAttribute acTable, "sec_User_Security", True
Application.SetHiddenAttribute acTable, "sec_Object_Security", True
'Application.AutomationSecurity = msoAutomationSecurityLow
'.Properties("Auto Compact") = False
'AppIcon
'StartUpForm
End With
MsgBox "Startup settings are set for general use. " & vbCrLf & _
"The Application will now close.", vbCritical, _
"General Use Settings!"
Application.Quit
End Function