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
NewAllowBypassKey = False
Call SetStartupProperties
'All settings will be in work after restarting app.
msgbox "Please restart application!"
docmd.quit
end if
end sub
Public NewAllowBypassKey As Variant
Function SetStartupProperties()
'Set icon what location is same DB location's
ChangeProperty "AppIcon", dbText, DirOfFile & "Cat.ico"
ChangeProperty "AppTitle", dbText, "Sample Database Special For Tek-Tips forums"
ChangeProperty "StartupForm", dbText, "frmSample"
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 DirOfFile(Optional strPath As String = "", Optional blnMasterDir As Boolean = False) As String
'Directory of file
DirOfFile = strPath
Dim i As Byte
If strPath = "" Then strPath = CurrentDb.Name
For i = 1 To Len(strPath)
If Mid(strPath, i, 1) = "\" Then
DirOfFile = Left(strPath, i)
If blnMasterDir = True Then
If i > 1 Then
If Mid(strPath, i - 1, 1) <> ":" Then
Exit For
End If
End If
End If
End If
Next i
End Function
Aivars
P.S. I can send sample DB what include several solution of users aministration, print setup, command buttons enabled/disabled and some other. I must only know what Access version do you use (2000 or 97)
alaganovskis@hotmail.com