1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Set db = DBEngine.Workspaces(0).OpenDatabase("C:\DOSSIER\BASE.mdb")
sql = "SELECT * FROM TOTO where NUMERO like '" & Text1.Text & "*'"
Set ds = db.CreateDynaset(sql)
If ds.EOF Then
Titre = "RECHERCHE JOURNEE"
Message = "Aucune fiche avec ce N°, réessayer ?"
Reponse = MsgBox(Message, 48 + 4, Titre)
If Reponse = 7 Then Unload ME
End If
ligne = 1
Do Until ds.EOF
MSFlexGrid1.Rows = 0
MSFlexGrid1.Cols = 3
MSFlexGrid1.ColWidth(0) = 1500
MSFlexGrid1.ColWidth(1) = 1800
MSFlexGrid1.ColWidth(2) = 500
MSFlexGrid1.AddItem ds("CHAMPS1") & Chr(9) & ds("CHAMPS2") & Chr(9) & ds("CHAMPS3")
ds.MoveNext
MSFlexGrid1.Rows = ligne + 1
Loop
End If |
Partager