这样:
Dim txt As String = e.Form.Controls("ComboBox1").Text
Dim tbl As Table = Tables("窗口1_Table1")
Dim Filter As String
With e.Form.Controls("DateTimePicker1")
If .Value IsNot Nothing Then
Filter = Filter & "日期 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("DateTimePicker2")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "日期 <= #" & .Value & "#"
End If
End With
If txt > "" Then
If filter > "" Then
Filter = Filter & "And 产品 Like '*" & txt & "*'"
Else
Filter= "产品 Like '*" & txt & "*'"
End If
End If
tbl.Filter = Filter
另一个请参照着修改即可