以文本方式查看主题

-  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=129558)

--  作者:tygzjsl
--  发布时间:2018/12/31 16:31:00
--  [求助]狐狸爸爸复选组合筛选
老师我建立了两checkedComboBox控件,这两个控件怎么才能达到组合相互筛选啊,也就是其中一个能筛选,别一个就不能筛选了,需要加什么代码,只是这样不行,需要帮助,谢谢!一个是考试时间列,别一个是班级列。

With e.Form.Controls("CheckedComboBox1")

    If .Value IsNot Nothing Then

        Filter &= " and 考试时间 in (\'" & .Value.replace(",", "\',\'") & "\')"

    End If

End With


With e.Form.Controls("CheckedComboBox2")

    If .Value IsNot Nothing Then

        Filter &= " and 班级 in (\'" & .Value.replace(",", "\',\'") & "\')"

    End If

End With


--  作者:tygzjsl
--  发布时间:2018/12/31 16:34:00
--  

[此贴子已经被作者于2018/12/31 16:38:23编辑过]

--  作者:y2287958
--  发布时间:2018/12/31 20:21:00
--  
自己标识一下首先参与的条件
--  作者:tygzjsl
--  发布时间:2018/12/31 23:14:00
--  

Dim Filter As String = "1=1"
是这个么,后面1=1是什么意思,非常感谢

--  作者:有点蓝
--  发布时间:2019/1/2 9:09:00
--  
Dim Filter As String = "1=1"

With e.Form.Controls("CheckedComboBox1")

    If .Value IsNot Nothing Then

        Filter &= " and 考试时间 in (\'" & .Value.replace(",", "\',\'") & "\')"

    End If

End With

if Filter = "1=1" then

With e.Form.Controls("CheckedComboBox2")

    If .Value IsNot Nothing Then

        Filter &= " and 班级 in (\'" & .Value.replace(",", "\',\'") & "\')"

    End If

End With

end if



--  作者:tygzjsl
--  发布时间:2019/1/2 18:34:00
--  
非常感谢两位老师