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
| Private Sub Commande9_Click()
Me.Requery
Dim sql As String
Dim rs As DAO.Recordset
Static i As Byte
sql = "SELECT * FROM Utilisateur WHERE NomUtilisateur = '" & Me.txt_user & "' AND MdpUtilisateur ='" & Me.txt_Password & "';"
Set rs = CurrentDb.OpenRecordset(sql)
If Not rs.EOF Then
If NomUtilisateur = 1 And MotDePasse = MdpUtilisateur Then
DoCmd.OpenForm "PageAdministrateur", acNormal, , , , acWindowNormal
DoCmd.Close acForm, "Login"
Else
MsgBox "(Identifiant, Mot de Passe) incorrect ", vbInformation, "Connexion"
End If
If NomUtilisateur > 1 And MotDePasse = MdpUtilisateur Then
DoCmd.OpenForm "PageUtilisateur", acNormal, , , , acWindowNormal
Else
MsgBox "(Identifiant, Mot de Passe) incorrect ", vbInformation, "Connexion"
End If
End If
Debug.Print
End Sub |
Partager