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
| On Error Resume Next
If Text1.Text = "" Then
MsgBox "Veuiller saisir un nom à rechercher", 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!age
Text4.Text = RS!date
Text5.Text = RS!diagnostic
Text6.Text = RS!plan
Text7.Text = RS!obs
Else
MsgBox "Aucun patient avec ce nom", vbInformation + _
vbMsgBoxRtlReading + vbOKOnly, "Attention"
End If
Text1.SetFocus
End If
End If |
Partager