e.Form.Controls("Label6").Text = "正在进行专业筛选,请稍后..."
Application.DoEvents()
Dim timestart,timeend As Date
timestart=Date.now
Dim Filter As String
With e.Form.Controls("ComboBox1")
If .Value IsNot Nothing Then
Filter = "首选科目 = '" & .Value & "'"
End If
End With
Dim s As String=e.Form.Controls("ComboBox2")
'考生选科数组
s=s.replace("物理","").replace("历史","").replace(",,",",").trim(",") '只剩下再选科目
Output.Show(s)
Dim Xks() As String '考生选科集合
Xks = s.split(",")
Dim Jhxks As List(Of String) '招生计划中的选科
Jhxks = DataTables("专业录取线").GetValues("再选科目")
Dim Xkmys As New List(Of String) '与我的选科匹配的选科集合
Xkmys.Add("不限")
Xkmys.Add(Xks(0) & "和" & Xks(1))
''单科加"或"
For Index As Integer = 0 To Xks.Length - 1 ’提示错误的位置在这里!
For Each Product As String In Jhxks
If (Product.contains(Xks(Index) & "或") Or Product.contains("或" & Xks(Index)) Or Product=Xks(Index)) And Xkmys.Contains(Product)=False Then
'filter=filter & "'" & Product & "'"
'Jhxks.Remove(Product)
Xkmys.Add(Product)
End If
Next
Next
'加组合,手动填加,
'开始生成筛选条件
Dim tj As String
For Each filter As String In Xkmys
tj = tj & "'" & filter & "',"
Next
tj="[再选科目] In (" & tj.trim(",") & ")"
Tables("专业录取线").Filter=tj
output.Show(tj)
With e.Form.Controls("ComboBox3")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = 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 = Filter & "文理分科 = '" & .Value & "'"
End If
End With
Dim txt As String = e.Form.Controls("TextBox1").Text
If txt > "" Then
If Filter >"" Then
Filter = Filter & " And "
End If
txt = "'%" & txt & "%'"
Filter = Filter & "(专业名称 Like " & txt & " Or 院校名称 Like " & txt & " Or 所在省份 Like " & txt & " Or A211院校 Like " & txt & ")"
End If
If e.Form.Controls("GF").text > ""
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "低分同位 <= " & e.Form.Controls("GF").text
End If
If e.Form.Controls("DF").text > ""
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "低分同位 >= " & e.Form.Controls("dF").text
End If
If Filter > "" Then
Tables("专业录取线").Filter = Filter
End If
Tables("专业录取线").Sort = "低分同位 DESC" '按"低分同位"列降序排列
e.Form.Controls("Label6").Text = "专业筛选完毕!."
timeend=Date.now
e.Form.Controls("Label6").text="耗时" & (timeend-timestart).TotalSeconds & "秒"
Messagebox.Show("专业筛选完毕,请继续!")
MainTable = Tables("专业录取线")