比如我想再以下查询设计中加入,不包含手机号码列中含6543和4987的条件,6543和4987设置为固定值不需要选择
标题 |
Click事件代码 |
清除条件 |
e.Form.Controls("cmbProduct").Value = Nothing e.Form.Controls("cmbCustomer").Value = Nothing e.Form.Controls("cmbEmployee").Value = Nothing e.Form.Controls("StartDate").Value = Nothing e.Form.Controls("EndDate").Value = Nothing |
撤销筛选 |
Tables("订单").ApplyFilter = False |
开始筛选 |
Dim Filter As
String With e.Form.Controls("cmbProduct") If .Value IsNot Nothing
Then Filter = "产品 = '" & .Value & "'" End
If End
With With e.Form.Controls("cmbCustomer") If .Value IsNot Nothing
Then If Filter > "" Then Filter = Filter & " And " End
If
Filter = Filter & "客户 = '" & .Value & "'" End
If End
With With e.Form.Controls("cmbEmployee") If .Value IsNot Nothing
Then If Filter >"" Then Filter = Filter & " And " End
If
Filter = Filter & "雇员 = '" & .Value & "'" End
If End
With With e.Form.Controls("StartDate") If .Value IsNot Nothing
Then If Filter >"" Then Filter = Filter & " And " End
If
Filter = Filter & "日期 >= #" & .Value & "#" End
If End
With With e.Form.Controls("EndDate") 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 |