1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
Private Sub connexion_Click()
Me.Requery
Dim sql, User_id, User_groupe As String
Dim rs As DAO.Recordset
Static i As Byte
sql = "SELECT * FROM T_USERS WHERE TRIGRAMME = '" & Me.txt_user & "' AND PASSWD ='"& Me.txt_pass & "';"
Set rs = CurrentDb.OpenRecordset(sql)
If Not rs.EOF Then
DoCmd.OpenForm "F_Autre_Formulaire", 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és", vbCritical
DoCmd.Quit
End If
End Sub |
Partager