Foxtable(狐表)用户栏目专家坐堂 → [求助]查询窗口如何增加固定条件筛选


  共有9640人关注过本帖平板打印复制链接

主题:[求助]查询窗口如何增加固定条件筛选

帅哥哟,离线,有人找我吗?
wangwenlon
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:22 积分:232 威望:0 精华:0 注册:2012/6/10 12:51:00
[求助]查询窗口如何增加固定条件筛选  发帖心情 Post By:2012/6/12 17:29:00 [只看该作者]

比如我想再以下查询设计中加入,不包含手机号码列中含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


 回到顶部