Probleme de boucle do loop
Voila je fais un recherche dans une table mais ya plusieurs resultats donc je demande d 'affiché les differents resultats dans une combo box pour que l utilisateurs selectionne celui de son choix le probleme c est que le dernier resultat s'affiche deux fois dans la combo box
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 27 28 29 30 31 32
| Private Sub cb_cp_Click()
Dim int_val_champ As Integer
Dim int_index As Integer
cb_localite.Clear
int_val_champ = Val(cb_cp.Text)
data_cp.Recordset.FindFirst "Code" & "=" & int_val_champ
cb_localite.AddItem data_cp.Recordset.Fields("Localite")
Do
If data_cp.Recordset.NoMatch = True Then
Exit Do
Else
data_cp.Recordset.FindNext "Code" & "=" & int_val_champ
cb_localite.AddItem data_cp.Recordset.Fields("Localite")
End If
Loop
End Sub |
meric d avance