以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]多个筛选条件组合  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=188729)

--  作者:lgj716330
--  发布时间:2023/10/13 19:49:00
--  [求助]多个筛选条件组合
                            If Filter > "" Then
                                Filter = Filter & " or "
                            End If
                            If drs11(n1)("用户列") = True And drs11(n1).IsNull("列内容") Then 
                                Filter = Filter & drs11(n1)("列名") & " = \'" & _UserName & "\'"
                            ElseIf drs11(n1)("用户列") = True And drs11(n1).IsNull("列内容") = False Then
                                Filter = Filter & drs11(n1)("列名") & " In (\'" & drs11(n1)("列内容").replace(",", "\',\'") & "\')"
                            Else
                                Filter = Filter & drs11(n1)("列名") & " In (\'" & drs11(n1)("列内容").replace(",", "\',\'") & "\')"
                            End If
标颜色处需要把Filter = Filter & drs11(n1)("列名") & " = \'" & _UserName & "\'"和Filter = Filter & drs11(n1)("列名") & " In (\'" & drs11(n1)("列内容").replace(",", "\',\'") & "\')"两个或条件组合起来,要怎么写

--  作者:有点蓝
--  发布时间:2023/10/14 8:43:00
--  
Filter = Filter & drs11(n1)("列名") & " = \'" & _UserName & "\' or " & drs11(n1)("列名") & " In (\'" & drs11(n1)("列内容").replace(",", "\',\'") & "\')"