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 33
|
Dim NomRecherche As String
Dim Matable As DataTable
Matable = DS_cabinet.Tables("_tbPATIENT")
'cree un objet dataview pour filtrer les enregistrements
Dim filtre As New DataView(Matable)
Dim CountItem As Integer
NomRecherche = InputBox("Veuillez entrer le nom recherché", "Recherche")
If NomRecherche = "" Then
MsgBox("veuillez entrer un nom à rechercher SVP")
'definition de notre table
Else
filtre.RowFilter = "nom like'*"& NomRecherche & "*'"
CountItem = filtre.Count
End If
If CountItem > 0 Then
txt_id.Text = filtre.Item(0)(0)
txt_nom.Text = filtre.Item(0)(1)
txt_prenom.Text = filtre.Item(0)(2)
txt_s.Text = filtre.Item(0)(3)
txt_a.Text = filtre.Item(0)(4)
txt_p.Text = filtre.Item(0)(5)
txt_adr.Text = filtre.Item(0)(6)
txt_tel.Text = filtre.Item(0)(7)
txt_m.Text = filtre.Item(0)(8)
Else : MsgBox("Innexistant")
End If
End Sub |
Partager