在文本框中录入多组关键字,用“,”分隔,模糊查询含有(或)关键字的记录。
窗口中TextBox1控件中的TextChanged代码,提示列名“c.name”不对。
应该怎样修改?谢谢!
With e.Form.Controls("TextBox1")
If .text IsNot Nothing Then
Dim str As String = "1=2"
For Each s As String In .text.split(",")
If s > "" Then
For Each c As Col In Tables("查询_Table1").Cols
'msgbox(c.name)
str &= " or c.name Like '%" & s & "%'"
Next
End If
Next
Tables("查询_Table1").Filter = str
End If
End With