- Код: Выделить всё
Private Sub edtQFilter_Change()
On Error GoTo LocalError:
Dim strQFilterAuto As String
If edtQFilter.Text = "" Then
DataCars.RecordSource = "SELECT * FROM Autos ORDER BY AutoNumber.Name "
Else
strQFilterAuto = _
" AutoName.Name LIKE '" & edtQFilter.Text & "%' OR" & _
" AutoNumber.Name LIKE '" & edtQFilter.Text & "%' OR" & _
" AutoModel.Name LIKE '" & edtQFilter.Text & "%' OR" & _
" AutoColor.Name LIKE '" & edtQFilter.Text & "%' OR" & _
" AutoCategory.Name LIKE '" & edtQFilter.Text & "%'"
DataCars.RecordSource = "SELECT * FROM Autos WHERE " & strQFilterAuto & _
" ORDER BY AutoNumber.Name "
End If
DBGridAuto.Refresh
Exit Sub
LocalError:
MsgBox MSG_ERR & Err.Number & MSG_SEP & Err.Description, vbCritical + vbOKOnly, APP_NAME
End Sub
edtQFilter - поле для ввода строки для фильтрации
DataCars - объект класса Adodc
DBGridAuto - объект класса TDBGrid
Ошибку програма не выдает, но и не делает то что надо1 подскажите, где косяк?