是如果有多个文本控件,应该乍样?是这样往后递加吗?
Dim filter As String = ""
Dim txt As String = e.Form.Controls("TextBox1").TEXT
If txt > "" Then
txt = "'%" & txt & "%'"
Filter = "部门名称 Like " & txt
End If
Dim txt1 As String = e.Form.Controls("TextBox2").TEXT
If txt1 > "" Then
txt1 = "'%" & txt1 & "%'"
If Filter > "" Then
Filter = Filter & " and 专业 Like " & txt1
Else
Filter = "专业 Like " & txt1
End If
End If
Dim txt2 As String = e.Form.Controls("TextBox3").TEXT
If txt2 > "" Then
txt2 = "'%" & txt2 & "%'"
If Filter > "" Then
Filter = Filter & " and 专业 Like " & txt1 & " and 学历 Like " & txt1
Else
Filter = "学历 Like " & txt2
End If
End If
If Filter > "" Then
Tables("机构").Filter = Filter
End If