Dim Filter As String
With e.Form.Controls("Textdengji")
If .Value IsNot Nothing Then
Dim txt As String = "'%" & .Value & "%'"
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & ("食品大类一级 Like " & txt & " Or 食品亚类二级 Like " & txt & " Or 食品品种三级 Like " & txt & " Or 食品细类四级 Like " & txt)
End If
End With
With e.Form.Controls("Textteam")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "convert(varchar,报价分组) like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("TextSTD")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "convert(varchar,标准) like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("TextItem")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "convert(varchar,检测项目) like '%" & .Value & "%'"
End If
End With
If Filter > "" Then
DataTables("B_TtemNo").LoadFilter = Filter
DataTables("B_TtemNo").Load
End If
请问这个代码应该如何改?