Récupérer la valeur pk_utilisateur
Bonjour,
J'ai fais ça en formulaire de connexion à ma BDD
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Private Sub connexion_Click()
Dim sql, ID_connexion, profil As String
Dim rs As DAO.Recordset
Static i As Byte
sql = "SELECT pk_utilisateur, profil FROM t_utilisateur WHERE login = '" & Me.login & "' AND password ='" & Me.password & "';"
Set rs = CurrentDb.OpenRecordset(sql)
If Not rs.EOF Then
DoCmd.OpenForm "f_navigation", acNormal, , , , acWindowNormal
DoCmd.Close acForm, "f_connexion"
ID_connexion = rs("pk_utilisateur").Value
profil_utilisateur = rs("profil").Value
Else
MsgBox "Identifiant ou 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 |
J'aimerai récupérer la valeur du champ pk_utilisateur et pas moyen
quelqu'un peu m'aider ?
Merci