1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Private Sub Commande9_Click()
Me.Requery
Dim sql, User_id, User_groupe As String
Dim rs As DAO.Recordset
Static i As Byte
sql = "SELECT * FROM users WHERE TRIGRAMME = '" & Me.txt_user & "' AND PASWD ='" & Me.txt_pass & "';"
Set rs = CurrentDb.OpenRecordset(sql)
If Not rs.EOF Then
DoCmd.OpenForm "F_Intro", acNormal, , , , acWindowNormal
DoCmd.Close acForm, "F_Connexion"
User_id = rs("TRIGRAMME").Value
User_groupe = rs("GROUPE").Value
Else
MsgBox "(Identifiant, Mot de Passe) incorrect ", vbInformation, "Connexion"
i = i + 1
End If
If i = 3 Then
MsgBox "Vous avez dépassé le nombre de tentatives autorisées", vbCritical
DoCmd.Quit
End If
End Sub |
Partager