Bonjour,
pourquoi ce code ne s'occupe pas du select case cela ne fonctionne pas, sachant que les données (utilisateur BUDGET etc ), se trouve dans une liste modifiable sur le formulaire MENU
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110 Private Sub VALIDER_Click() 'Si l'identifiant ou le mot de passe n'est pas renseigné alors If IsNull(Me!TXTID) Or IsNull(Me!MDP) Then 'Message MsgBox ("Renseigner les champs!") Me.TXTID.SetFocus 'Sinon Else 'Appel d'une variable Dim valide As String 'Rechercher le mot de passe correspondant à l'identifiant If IsNull(DLookup("MDP", "T_UTILISATEUR", "[ID] = Forms!F_IDENTIFICATION!TXTID")) Then MsgBox ("Identifiant inconnu !") Me.TXTID.SetFocus Me.TXTID = "" Else valide = DLookup("MDP", "T_UTILISATEUR", "[ID] = Forms!F_IDENTIFICATION!TXTID") 'Si le mot de passe inscrit n'est pas correct alors If (Me!MDP <> valide) Or IsNull(Me!TXTID) Or IsNull(Me!MDP) Then 'Message MsgBox ("Mot de Passe incorrect !") Me.MDP.SetFocus Me.MDP = "" End If securite = DLookup("Utilisateur", "T_UTILISATEUR", "[ID] = Forms!F_IDENTIFICATION!TXTID") Select Case securite Case "ADMIN" DoCmd.Close acForm, "F_IDENTIFICATION" 'DoCmd.OpenForm "F_MENU" Forms![F_MENU]!Modifiable73.Enabled = True Forms![F_MENU]!connexion.Enabled = False Forms![F_MENU]!deconnexion.Enabled = True Case "GESTPRIN" DoCmd.Close acForm, "F_IDENTIFICATION" DoCmd.OpenForm "F_MENU" Forms![F_MENU]!Modifiable73.Enabled = True 'Forms![F_MENU]!BUDGET.Enabled = False Forms![F_MENU]!Utilisateur.Enabled = False 'Forms![F_MENU]!CHANGER_MDP.Enabled = False Case "GESTSEC" DoCmd.Close acForm, "F_IDENTIFICATION" DoCmd.OpenForm "F_MENU" Forms![F_MENU]!BUDGET.Enabled = False Forms![F_MENU]!Utilisateur.Enabled = False Forms![F_MENU]!MISSION.Enabled = False Forms![F_MENU]!REPORTINGS.Enabled = False 'Forms![F_MENU]!CHANGER_MDP.Enabled = False Forms![F_MENU]!commande47.Enabled = False DoCmd.OpenForm "F_MENU" Forms![F_MENU]!EDITION.Enabled = False Forms![F_MENU]!BUDGET.Enabled = False Forms![F_MENU]!Utilisateur.Enabled = False Forms![F_MENU]!MISSION.Enabled = False Forms![F_MENU]!REPORTINGS.Enabled = False 'Forms![F_MENU]!STATS.Enabled = False Forms![F_Planning]!doléances.Enabled = False Forms![F_Planning]!SPDA.Enabled = False 'Forms![F_MENU]!CHANGER_MDP.Enabled = False Case "SECRETARIAT" DoCmd.Close acForm, "F_IDENTIFICATION" DoCmd.OpenForm "F_MENU" Forms![F_MENU]!EDITION.Enabled = False Forms![F_MENU]!BUDGET.Enabled = False Forms![F_MENU]!Utilisateur.Enabled = False Forms![F_MENU]!MISSION.Enabled = False Forms![F_MENU]!REPORTINGS.Enabled = False 'Forms![F_MENU]!STATS.Enabled = False Case Else End Select DoCmd.SetWarnings False 'DoCmd.RunSQL (Insert) 'Réactive les warnings DoCmd.RunSQL (Insert) DoCmd.SetWarnings True 'Fermer le formulaire End If End If End Sub
merci pour votre aide
Partager