以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  请问想筛选包含某个人的行该怎么写代码  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=107424)

--  作者:1452565001
--  发布时间:2017/9/27 18:06:00
--  请问想筛选包含某个人的行该怎么写代码
Dim Filter1 As String
With e.Form.Controls("ComboBox2")
    If .Value IsNot Nothing Then
        Filter1 = "r1000 = \'" & .Value & "\'"
    End If
End With
With e.Form.Controls("ComboBox1")
    If .Value IsNot Nothing Then
        If Filter1 >"" Then
            Filter1 = Filter1 & " And "
        End If
        Filter1 = Filter1 & "r125 >= \'" & .Value & "\'"
    End If
End With

想自己做筛选窗口,然后希望125列中只要包含ComboBox1中填写的数据的行就会被筛选出来,请问这个该如何改?

--  作者:有点甜
--  发布时间:2017/9/27 20:37:00
--  

改成

 

Filter1 = Filter1 & "r125 like \'%" & .Value & "%\'"