Foxtable(狐表)用户栏目专家坐堂 → [求助]再问窗口筛选_可否实现输入的多条件都实现模糊筛选?


  共有13683人关注过本帖树形打印复制链接

主题:[求助]再问窗口筛选_可否实现输入的多条件都实现模糊筛选?

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


加好友 发短信 一级勋章 三级勋章 二级勋章
等级:超级版主 帖子:6318 积分:33963 威望:0 精华:10 注册:2008/8/31 20:56:00
  发帖心情 Post By:2010/4/27 22:16:00 [显示全部帖子]

这样?

Dim Filter As String
With e.Form.Controls("cmbProduct")
    If .Value IsNot Nothing Then
        Filter = "产品 Like '*" & .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 & "客户 Like '*" & .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 & "雇员 Like '*" & .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


 回到顶部