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
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 .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "日期 <= #" & .Value & "#"
End If
End With
If Filter > "" Then
Tables("订单").Filter = Filter
End If