Foxtable(狐表)用户栏目专家坐堂 → [求助]想做一个筛选窗口,认为未填写内容的单元格都符合筛选条件,请问如何实现?


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

主题:[求助]想做一个筛选窗口,认为未填写内容的单元格都符合筛选条件,请问如何实现?

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/3/15 10:53:00 [显示全部帖子]

or 条件,要加上括号

 

DataTables("b1").Save()
Dim Filter1 As String
With e.Form.Controls("TextBox1")
    If .Value IsNot Nothing Then
        Filter1 = "(a1 <= '" & .Value & "' or a1 is null)"
    End If
End With
With e.Form.Controls("TextBox1")
    If .Value IsNot Nothing Then
        If Filter1 >"" Then
            Filter1 = Filter1 & " And "
        End If
        Filter1 = Filter1 & "(a21 >= '" & .Value & "' or a21 is null)"
    End If
End With
With e.Form.Controls("TextBox2")
    If .Value IsNot Nothing Then
        If Filter1 >"" Then
            Filter1 = Filter1 & " And "
        End If
        Filter1 = Filter1 & "(a11 >= '" & .Value & "' or a11 is null)"
    End If
End With
With e.Form.Controls("ComboBox6")
    If .Value IsNot Nothing Then
        If Filter1 >"" Then
            Filter1 = Filter1 & " And "
        End If
        Filter1 = Filter1 & "(a17 like '%" & .Value & "%' or a17 is null)"
    End If
End With
If Filter1 > "" Then
    Tables("a1").Filter = Filter1
End If


 回到顶部