Dim ClickNum As Integer Private Sub Combo1_Click() 'Compte le nombre de click ClickNum = ClickNum + 1 ' Remplissage Select Case ClickNum Case 1 Text1 = Combo1.Text Case 2 Text2 = Combo1.Text Case 3 Text3 = Combo1.Text Case 4 Text4 = Combo1.Text End Select End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub rechercher_Click() On Error Resume Next If Text1.Text = "" Then MsgBox "Veuiller saisir un nom à chercher", vbInformation + _ vbMsgBoxRtlReading + vbOKOnly, "Attention" End If If Text1.Text <> "" Then If IsNumeric(Text1) = False Then Set RS = New ADODB.Recordset RS.Open "select * from patient where nom like '%" & Text1.Text & "%'" And prenom like '%" & Text2.Text & "%'", DB, adOpenStatic, adLockOptimistic If RS.RecordCount > 0 Then Text1.Text = RS!Nom Text2.Text = RS!Prenom Text3.Text = RS!somme Text4.Text = RS!versement1 Text5.Text = RS!versement2 Text6.Text = RS!versement3 Text7.Text = RS!reste Else MsgBox "Aucun patient avec ce nom", vbInformation + _ vbMsgBoxRtlReading + vbOKOnly, "Attention" End If Text1.SetFocus End If End If End Sub