Dim str1 As String Dim str2 As String Dim flt As String For Each s As String In e.Form.Controls("CheckedComboBox1").Text.split(",") str1 =str1 & ",'" & s & "'" Next For Each s As String In e.Form.Controls("CheckedComboBox2").Text.split(",") str2 =str2 & ",'" & s & "'" Next If str1 > "" Then flt = "第二列 in (" & str1.trim(",") & ")" End If If str2 > "" Then If str1 = "" Then flt = "第三列 in (" & str2.trim(",") & ")" Else flt = Flt & "And 第三列 in (" & str2.trim(",") & ")" End If End If Tables("表A").Filter = flt
|