Problème avec Bouton de Déplacement "Précédent et suiva
Bonjour à tous,
Voilè mon problème :
J'ai créer 2 bouton de déplacements : Précédent et suivant mais il ne marche qu'une fois.
Voici mon code pour le bouton Précédent :
Code:
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 Commande87_Click()
On Error GoTo Err_Commande87_Click
Dim P As DAO.Recordset
Set P = CurrentDb.OpenRecordset("Select * From CLIENT Where Code_Commerciaux = " & Chr(34) & Modifiable3 & Chr(34))
Texte16 = P.Fields("Num_Clt")
Texte18 = P.Fields("Nom_Clt")
Texte26 = P.Fields("Adr_Rue_Clt")
Texte29 = P.Fields("Adr_Ville_Clt")
Texte32 = P.Fields("Adr_CP_Clt")
Texte36 = P.Fields("Tel_Clt")
Texte40 = P.Fields("Présentation_Clt")
P.MovePrevious
Set P = Nothing
Exit_Commande87_Click:
Exit Sub
Err_Commande87_Click:
MsgBox Err.Description
Resume Exit_Commande87_Click
End Sub |
Et Voici le code pour le bouton Suivant :
Code:
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 Commande44_Click()
On Error GoTo Err_Commande44_Click
Dim P As DAO.Recordset
Set P = CurrentDb.OpenRecordset("Select * From CLIENT Where Code_Commerciaux = " & Chr(34) & Modifiable3 & Chr(34))
If Not P.EOF Then
P.MoveNext
Texte16 = P.Fields("Num_Clt")
Texte18 = P.Fields("Nom_Clt")
Texte26 = P.Fields("Adr_Rue_Clt")
Texte29 = P.Fields("Adr_Ville_Clt")
Texte32 = P.Fields("Adr_CP_Clt")
Texte36 = P.Fields("Tel_Clt")
Texte40 = P.Fields("Présentation_Clt")
End If
P.Close
Set P = Nothing
Exit_Commande44_Click:
Exit Sub
Err_Commande44_Click:
MsgBox Err.Description
Resume Exit_Commande44_Click
End Sub |
Pouvez-vous m'aider car je n'arrive pas à trouver la solution?
Merci d'avance