Dim Filter As String = "1=1"
With e.Form.Controls("textbox1")
If .Value IsNot Nothing Then
Filter = Filter & " and 科类 = '" & .Value & "'"
End If
End With
With e.Form.Controls("textbox2")
If .Value IsNot Nothing Then
Filter = Filter & " and 录取批次 like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("textbox3")
If .Value IsNot Nothing Then
Filter = Filter & " and 院校名称 = '" & .Value & "'"
End If
End With
With e.Form.Controls("textbox4")
If .text <> Nothing Then
Dim flt As String = "1=2"
For Each s As String In .text.split(" ")
flt &= " or 院校名称 like '%" & s & "%' or 专业名称 like '%" & s & "%'"
Next
filter &= " and (" & flt & ")"
End If
End With
With e.Form.Controls("ComboBox1")
If .Value IsNot Nothing Then
Filter &= " and 年度 in ('" & .Value.replace(",", "','") & "')"
End If
End With
Tables("高考信息查询表汇总").Filter = Filter
Tables("高考信息查询表汇总").Sort = "院校名称,专业名称 desc,年度 desc,最低分分数 desc"
应该怎么加集合,小白啊,不懂啊。不想重新筛选,会影响速度吧,想回到上一步。非常谢谢!