Dim Filter As String
With e.Form.Controls("开始日期")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = 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
With e.Form.Controls("订单号")
If .Text > ""Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "订单号 = '" & .Text & "'"
End If
End With
With e.Form.Controls("电话")
If .Text > "" Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "电话 = '" & .Text & "'"
End If
End With
With e.Form.Controls("销售商编号")
If .Text > "" Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "销售商编号 = '" & .Text & "'"
End If
End With
msgbox(Filter )
e.Form.Controls("线下订单数据表").Table.Filter = filter