Dim Filter As String
With e.Form.Controls("combobox1")
If .Value IsNot Nothing Then
Filter = "考试性质= '" & .Value & "'"
End If
End With
With e.Form.Controls("combobox2")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter &= "考试年月= '" & .Value & "'"
End If
End With
With e.Form.Controls("combobox3")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter &= "班级= '" & .Value & "'"
End If
End With
With e.Form.Controls("combobox4")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter &= "科类= '" & .Value & "'"
End If
End With
With e.Form.Controls("combobox5")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter &= "姓名= '" & .Value & "'"
End If
End With
If Filter > "" Then
Tables("成绩表").Filter = Filter
End If
[此贴子已经被作者于2019/6/2 11:01:21编辑过]