Dim s1 As String = e.Form.Controls("ComboBox1").text
Dim s2 As String =e.Form.Controls("ComboBox2").Value
Dim s3 As String =e.Form.Controls("ComboBox3").Value
Dim s4 As String =e.Form.Controls("ComboBox4").Value
Dim s5 As String =e.Form.Controls("ComboBox5").Value
Dim s6 As String =e.Form.Controls("ComboBox6").Value
Dim s7 As String =e.Form.Controls("ComboBox7").Value
Dim tb1234 As Table = Tables("表A")
Dim filter As String = "1=1"
If s1 > "" Then
s1 = "'%" & s1 & "%'"
filter = filter & " and 第一列 Like " & s1
End If
s2 = e.Form.Controls("ComboBox2").Text
If s2 > "" Then
s2 = "'%" & s2 & "%'"
filter = filter & " and 第一列 Like " & s2
End If
s3 = e.Form.Controls("ComboBox3").Text
If s3 > "" Then
s3 = "'%" & s3 & "%'"
filter = filter & " and 第一列 Like " & s3
End If
s4 = e.Form.Controls("ComboBox4").Text
If s4 > "" Then
s4 = "'%" & s4 & "%'"
filter = filter & " and 第一列 Like " & s4
End If
tb1234.filter = filter
上面代码,筛选出表A第一列值,含窗口控件1 2 3 4的值行,
求助,同时筛选出表A第一列值,含窗口控件1 2 3 5的值行