是的。
太多的话,可以参考下面的简化:
Dim filter As String = ""
Dim nms1() As String = {"部门名称","专业","学历")
Dim nms1() As String = {"TextBox1","TextBox2","TextBox3")
For i As Integer = 0 To nms1.Length - 1
Dim txt As String = e.Form.Controls("TextBox1").text
If txt > "" Then
If Filter > "" Then
Filter = Filter & " and "
End If
Filter = Filter & nms1(i) & " Like '%" & txt & "%'"
End If
Next
If Filter > "" Then
Tables("机构").Filter = Filter
End If