模糊搜索后台数据,再加上特定字段,该怎么写?
Dim Filter As String
Dim tbl As Table = Tables("订单_table1")
With e.Form.Controls("textbox1")
If .Value IsNot Nothing Then
Filter = "客户名称 like '%" & .Value & "%' Or 公司名称 like '%" & .Value & "%' “
End If
End With
With e.Form.Controls("textbox2")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "产品名称 like '%" & .Value & "%'”
End If
End With
With e.Form.Controls("DateTimePicker1")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "日期 >= '" & .Value & "'"
End If
End With
If Filter > "" Then
tbl.DataTable.loadFilter = Filter
tbl.DataTable.loadPage = 0
tbl.DataTable.load
End If
在上述搜索加上筛选条件: 类别 = 优秀
If Filter > "" Then
tbl.DataTable.loadFilter = Filter & "类别='优秀'"
tbl.DataTable.loadPage = 0
tbl.DataTable.load
End If
出现错误:“'类别' 附近有语法错误。”