Dim Filter As String
With e.Form.Controls("开始")
If .Value IsNot Nothing Then
Filter = "记录时间 >= #" & .Value & "#"
End If
End With
……
With e.Form.Controls("店铺名称")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "店铺名称 = '" & .Value & "'"
End If
End With
Dim txt1 As String = e.Form.Controls("TextBox1").Text
Dim tb1 As Table = Tables("主控窗口_Table2")
Dim f1 As String = Filter
Dim Values() As String
Values = txt1.split(",")
For Index As Integer = 0 To Values.Length - 1
If f1 > "" Then f1= f1 & " and "
Dim txt As String =Values(Index)
txt = "'%" & txt & "%'"
f1= f1 & "(店铺名称 Like " & txt & " Or 单号 Like " & txt & " Or 处理人 Like " & txt & " Or 发货仓库 Like" & txt & " Or 物流公司 Like" & txt & " Or 赠送SKU Like" & txt & " Or 客户姓名 Like" & txt & " Or 系统单号 Like" & txt & " Or 产品类别 Like " & txt & " Or 配件SKU Like " & txt & " Or 产品SKU Like " & txt & " Or 联系方式 Like " & txt & " Or 追踪号 Like " & txt & " Or 处理方式 Like " & txt & " Or 备注 Like " & txt & " Or 回访 Like" & txt & " Or 状态 Like" & txt & " Or 寄送地址 Like " & txt & " Or [状况描述 原因] Like " & txt & ")"
Next
Dim Filter2 As String
With e.Form.Controls("开始2")
If .Value IsNot Nothing Then
Filter2 = Filter2 & "记录时间 >= #" & .Value & "#"
End If
End With
……
With e.Form.Controls("处理人2")
If .Value IsNot Nothing Then
If Filter2 >"" Then
Filter2 = Filter2 & " And "
End If
Filter2 = Filter2 & "处理人 = '" & .Value & "'"
End If
End With
Dim txt2 As String = e.Form.Controls("TextBox6").Text
Dim tb2 As Table = Tables("主控窗口_Table2")
Dim f3 As String = Filter2
Dim Values() As String
Values = txt2.split(",")
For Index As Integer = 0 To Values.Length - 1
If f3 > "" Then f3= f3 & " and "
Dim txt As String =Values(Index)
txt = "'%" & txt & "%'"
f3= f3 & "(店铺名称 Like " & txt & " Or 单号 Like " & txt & " Or 处理人 Like " & txt & " Or 发货仓库 Like" & txt & " Or 物流公司 Like" & txt & " Or 赠送SKU Like" & txt & " Or 客户姓名 Like" & txt & " Or 系统单号 Like" & txt & " Or 产品类别 Like " & txt & " Or 配件SKU Like " & txt & " Or 产品SKU Like " & txt & " Or 联系方式 Like " & txt & " Or 追踪号 Like " & txt & " Or 处理方式 Like " & txt & " Or 备注 Like " & txt & " Or 回访 Like" & txt & " Or 状态 Like" & txt & " Or 寄送地址 Like " & txt & " Or [状况描述 原因] Like " & txt & ")"
Next
If f1 > "" AndAlso f3 > "" Then
Tables("主控窗口_Table2").Filter = "(" & f1 & ") or (" & f3 & ")"
Else
If f1 > "" Then
Tables("主控窗口_Table2").Filter = f1
ElseIf f3> "" Then
Tables("主控窗口_Table2").Filter = f3
else
Tables("主控窗口_Table2").Filter = ""
End If
End If
[此贴子已经被作者于2021/10/7 11:11:51编辑过]