1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| Public Function Démarrer()
'Dim i As Integer
Const DB_Boolean As Long = 1
Dim i As Integer
Dim regi As String
' les menus et les commandes de l'Admin
If EstDansGroupe("SuperAdmins") Then
DoCmd.SelectObject acTable, , True
DoCmd.ShowToolbar "barre de menus", acToolbarYes 'Montre le menu "barre de menus"
DoCmd.ShowToolbar "Base de données", acToolbarYes 'Montre le menu "Base de données"
DoCmd.ShowToolbar "SudFidMenu", acToolbarNo 'Cache le menu "SudFid"
'Autorise pas la touche Shift au prochain démarrage
changeproperty "AllowBypassKey", DB_Boolean, True
changeproperty "AllowToolbarChanges", DB_Boolean, True
changeproperty "AllowBuiltinToolbars", DB_Boolean, True
changeproperty "AllowSpecialKeys", DB_Boolean, True
changeproperty "AllowFullMenus", DB_Boolean, True
changeproperty "StartUpMenuBar", DB_Boolean, True
changeproperty "StartUpShortCutMenuBar", DB_Boolean, True
changeproperty "AllowShortCutMenus", DB_Boolean, True
changeproperty "StartupShowDBWindow", DB_Boolean, True
changeproperty "StartupShowStatusBar", DB_Boolean, True
Else
'Si utilisateur n'est pas un "Admin" alors on cache la fenêtre BD,
' les menus et les commandes de l'Admin
'On cache la fenêtre BD
DoCmd.SelectObject acTable, , True
DoCmd.RunCommand acCmdWindowHide
'N'autorise pas la touche Shift au prochain démarrage
changeproperty "AllowBypassKey", DB_Boolean, False
'Form caché pour le contrôle de l'inactivité
DoCmd.OpenForm "F_CachéInactivité", , , , , acHidden
'On Change les options de démarrage
changeproperty "AllowToolbarChanges", DB_Boolean, False
changeproperty "AllowBuiltinToolbars", DB_Boolean, False
changeproperty "AllowSpecialKeys", DB_Boolean, False
changeproperty "AllowFullMenus", DB_Boolean, False
changeproperty "StartUpMenuBar", DB_Boolean, False
changeproperty "StartUpShortCutMenuBar", DB_Boolean, False
changeproperty "AllowShortCutMenus", DB_Boolean, False
changeproperty "StartupShowDBWindow", DB_Boolean, False
changeproperty "StartupShowStatusBar", DB_Boolean, False
'Par sécurité, on recache les barres de menu
DoCmd.ShowToolbar "barre de menus", acToolbarNo 'Cache le menu "barre de menus"
DoCmd.ShowToolbar "base de données", acToolbarNo 'Cache le menu "Base de données"
DoCmd.ShowToolbar "mode formulaire", acToolbarNo 'Cache le menu "mode formulaire"
DoCmd.ShowToolbar "SudFidMenu", acToolbarYes 'Montre le menu sudfid
End If
End Function |
Partager