if len(T_Rech.text)>=3 then SQL = "select * from Articles Code LIKE '" & T_Rech.text & "%' order by Code" '...
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionOption Explicit Private BAZ As clsADO Private Sub Form_Load() Set BAZ = New clsADO BAZ.DBConnect App.Path & "\BaseDonnee.mdb" BAZ.RSExecute "SELECT * FROM Articles;" 'ah bon? tu ne l'utilises pas?.... End Sub Private Sub Form_Unload(Cancel As Integer) Set BAZ = Nothing End Sub Private Sub T_Rech_Change() Dim i As Integer If Len(T_Rech.Text) >= 3 Then If BAZ.RSExecute("SELECT * FROM Articles WHERE Code LIKE '%" & T_Rech.Text & "%' ORDER BY Code;") Then BAZ.RS.MoveFirst Tablo.Rows = BAZ.RS.RecordCount + 1 i = 1 Do While Not .EOF If IsNull(.Fields("Code")) Then Tablo.TextMatrix(i, 0) = "" Else Tablo.TextMatrix(i, 0) = BAZ.RS!Code End If If IsNull(.Fields("Designation")) Then Tablo.TextMatrix(i, 1) = "" Else Tablo.TextMatrix(i, 1) = BAZ.RS!Designation End If i = i + 1 BAZ.RS.MoveNext Loop Else Tablo.Rows = 1 End If Else Tablo.Rows = 1 End If End Sub