With e.Form.Controls("CheckedComboBox1") If .Value IsNot Nothing Then
Filter = Filter & " and nd = \'" & .Value & "\'" End If End With
此主题相关图片如下:1.jpg
此主题相关图片如下:2.jpg
-- 作者:有点蓝
-- 发布时间:2019/1/2 8:40:00
--
With e.Form.Controls("CheckedComboBox1")
If .Value IsNot Nothing Then
Filter = Filter & " and nd in (\'" & .Value.replace(",","\',\'") & "\')"
End If
End With
-- 作者:tygzjsl
-- 发布时间:2019/1/2 20:22:00
--
With e.Form.Controls("checkedComboBox1")
If .Value IsNot Nothing Then
Filter = "nd In (\'" & .Value.Replace(",", "\',\'") & "\')"
End If
End With
If Filter > "" Then
Tables("信息查询表").Filter = Filter
End If
老师这两个代码都能实现,有什么区别谢谢啦!
-- 作者:有点甜
-- 发布时间:2019/1/2 20:36:00
--
1、贴出完整代码说明问题。
2、说明现在报什么错。
-- 作者:tygzjsl
-- 发布时间:2019/1/2 20:55:00
--
Dim Filter As String = "1=1"
With e.Form.Controls("combobox1") If .Value IsNot Nothing Then Filter = Filter & " and kl = \'" & .Value & "\'" End If End With
With e.Form.Controls("CheckedComboBox1") If .Value IsNot Nothing Then Filter &= " and nd in (\'" & .Value.replace(",", "\',\'") & "\')" End If End With
With e.Form.Controls("CheckedComboBox2") If .Value IsNot Nothing Then Filter &= " and yxdq in (\'" & .Value.replace(",", "\',\'") & "\')" End If End With
With e.Form.Controls("combobox2") If .Value IsNot Nothing Then
Filter = Filter & " and lqpc like \'%" & .Value & "%\'" End If End With