注意And和Like前后都要有空格的。 Dim qu As WinForm.ComboBox = e.Form.Controls("区") Dim zxx As WinForm.ComboBox = e.Form.Controls("中小学") Dim xx As WinForm.ComboBox = e.Form.Controls("学校") Dim xm As WinForm.ComboBox = e.Form.Controls("项目") Tables("报名表").Filter="区= '" & qu.Text & "' And 中小学 like '*" & zxx.Text & "*' and 学校 like '*" & xx.Text & "*' and 参赛项目 like '*" & xm.Text & "*'" 如果还是不行,就用messagebox.show显示一下合成的条件表达式,看看是什么: Dim qu As WinForm.ComboBox = e.Form.Controls("区") Dim zxx As WinForm.ComboBox = e.Form.Controls("中小学") Dim xx As WinForm.ComboBox = e.Form.Controls("学校") Dim xm As WinForm.ComboBox = e.Form.Controls("项目") Dim flt As String = "区= '" & qu.Text & "' And 中小学 like '*" & zxx.Text & "*' and 学校 like '*" & xx.Text & "*' and 参赛项目 like '*" & xm.Text & "*'" MessageBox.Show(flt) Tables("报名表").Filter= flt
|