Hi!
There are codes for
StartUp setting. You can call function on start of application for StartUp setting. Also this function set "By pass key" (allow or not to open application with <Shift> key ie. suspend StartUp), "Special keys> False or True etc. It's important for users work. I made special form for calling this function and setting StartUp: form open is allowed only to Admins group users.
Private Sub On_Open()
If CurrentDb.Properties("AllowBypassKey"

=True Then
'Here I check for permission of CurrentUser and
'If CurrentUser have not Admins group then I set
if IsUserInGroup=false then
NewAllowBypassKey = False
Call SetStartupProperties
'All settings will be in work after restarting app.
msgbox "Please restart application!"
docmd.quit
else
NewAllowBypassKey = true
Call SetStartupProperties
msgbox "On next application's starting you will be opened it in dialog mode by using <Shift> key"
end if
end if
end sub
'--------------------------
Public NewAllowBypassKey As Variant
'--------------------------
Function SetStartupProperties()
'Set DB icon
ChangeProperty "AppIcon", dbText, & "C:\MyFolder\MyIcon.ico"
ChangeProperty "AppTitle", dbText, "My Database Name"
ChangeProperty "StartupForm", dbText, "MyStartFormName"
ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "StartupShowStatusBar", dbBoolean, True 'or NewAllowBypassKey
ChangeProperty "AllowBuiltinToolbars", dbBoolean, NewAllowBypassKey
ChangeProperty "AllowFullMenus", dbBoolean, NewAllowBypassKey
ChangeProperty "AllowBreakIntoCode", dbBoolean, NewAllowBypassKey
ChangeProperty "AllowSpecialKeys", dbBoolean, NewAllowBypassKey
ChangeProperty "AllowBypassKey", dbBoolean, NewAllowBypassKey
ChangeProperty "StartUpMenuBar", dbText, "MyUserMenu"
ChangeProperty "AllowToolbarChanges", dbBoolean, NewAllowBypassKey
ChangeProperty "AllowShortcutMenus", dbBoolean, NewAllowBypassKey
ChangeProperty "StartupShortcutMenuBar", dbBoolean, NewAllowBypassKey
End Function
'--------------------------
Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
Dim dbs As Database, prp As Property
Const conPropNotFoundError = 3270
Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True
Change_Bye:
Exit Function
Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function
'--------------------------
Function IsUserInGroup(Optional strUser As String = "", Optional strGroup As String = ""
As Boolean
'This is function for verifying of user's group
'If is omitted strUser (user name), CurrentUser is verified
'If is omitted strGroup (user group), "Admins" group is verified
On Error GoTo Err_IsUserInGroup
Dim usr As User
If strUser = "" Then strUser = CurrentUser
If strGroup = "" Then strGroup = "Admins"
Set usr = DBEngine.Workspaces(0).Groups(strGroup).Users(strUser)
'If group <strGroup> have not user <strUser> then error is generated
IsUserInGroup = True
Exit_IsUserInGroup:
Exit Function
Err_IsUserInGroup:
If Err.Number <> 3265 Then '3265 >>> Item not found in this collection:
'consequently IsUserInGroup = False
MsgBox "Error No " & Err.Number & vbLf & Err.Description, , "Function IsUserInGroup"
End If
Resume Exit_IsUserInGroup
End Function
Also look at thread181-123565
Here is site's address for learning more about MS Access Workgroup Administration:
For DB security you can use
User-level security wizard
Push <Menu bar>;<Tools>;<Security>;<User-level security wizard...>
Aivars