Foxtable(狐表)用户栏目专家坐堂 → [求助]需把高级筛选放在窗口中


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

主题:[求助]需把高级筛选放在窗口中

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


加好友 发短信
等级:幼狐 帖子:172 积分:1914 威望:0 精华:0 注册:2012/6/6 17:08:00
  发帖心情 Post By:2014/1/24 13:24:00 [显示全部帖子]

Dim Filter As String
With e.Form.Controls("控件1")
    If .Value IsNot Nothing Then
        Filter = "列名1 = '" & .Value & "'"
    End If
End With
With e.Form.Controls("控件2")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If 
        Filter = Filter & "列名2 = '" & .Value & "'"
    End If
End With
With e.Form.Controls("控件3")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If 
        Filter = Filter & "列名3 = '" & .Value & "'"
    End If
End With

If Filter > "" Then
    Tables("表A").Filter = Filter
End If

 回到顶部