Dim Filter As String = "1=1"
Dim v1 As String = e.form.controls("textbox1").text
If v1 > "" Then
filter &= " And zdffs >= " & v1
End If
Dim v2 As String = e.form.controls("textbox2").text
If v2 > "" Then
filter &= " And zdffs <= " & v2
end if
With e.Form.Controls("院校地区:")
If .Value IsNot Nothing Then
Filter &= " and yxdq = '" & .Value & "'"
End If
End With
With e.Form.Controls("院校地址:")
If .Value IsNot Nothing Then
Filter = Filter & " and yxdz = '" & .Value & "'"
End If
End With
With e.Form.Controls("院校名称:")
If .Value IsNot Nothing Then
Filter = Filter & " and yxmc = '" & .Value & "'"
End If
End With
With e.Form.Controls("专业名称:")
If .Value IsNot Nothing Then
Filter = Filter & " and zymc = '" & .Value & "'"
End If
End With
With e.Form.Controls("年 度:")
If .Value IsNot Nothing Then
Filter = Filter & " and nd = '" & .Value & "'"
End If
End With
With e.Form.Controls("科 类:")
If .Value IsNot Nothing Then
Filter = Filter & " and kl = '" & .Value & "'"
End If
End With
msgbox(filter)
Tables("高考信息查询表").Filter = Filter
[此贴子已经被作者于2018/3/7 11:08:57编辑过]