Dim Filter As String = " 1=1 "
With e.Form.Controls("combobox1")
If .Value IsNot Nothing Then
Filter = Filter & " and 班级 like \'%" & .Value & "%\'"
End If
End With
Dim s As String = e.Form.Controls("CheckedComboBox1").text
If s.Contains("语文") AndAlso s.Contains("英语") Then
Filter = Filter & " and 优势科目 in (\'全部\',\'语文\',\'英语\',\'语文或理综\') "
End If
If s.Contains("语文") AndAlso s.Contains("理综") Then
Filter = Filter & " and 优势科目 in (\'全部\',\'语文\',\'理综\',\'语文或理综\',\'语文和理综\') "
End If
Tables("考生成绩表").Filter = Filter