给了帮助都不看不用,既然基础不好,就多按帮助的用法使用
Dim Filter As String
With e.Form.Controls("CheckedComboBox1")
If .Value IsNot Nothing Then
Filter = "年级 in ('" & .Value.replace(",", "','") & "'"
End If
End With
With e.Form.Controls("CheckedComboBox2")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "班级 in ('" & .Value.replace(",", "','") & "')"
End If
End With……
For Each dr1 As DataRow In DataTables("表A").select(Filter)