以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]Filter筛选特殊字符问题 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=179555) |
-- 作者:王小风 -- 发布时间:2022/8/29 18:26:00 -- [求助]Filter筛选特殊字符问题 代码如下:在文本框内不能输入特殊字符(报错),因”规格“中包含的特殊字符较多,大佬我应该怎么写? Dim txt As String = e.Form.Controls("TextBox1").Text Dim tbl As Table = Tables("备件库查询_Table1") If txt = "" Then tbl.Filter = "" Else txt = "\'%" & txt & "%\'" tbl.Filter = "识别码 Like " & txt & " Or 分类 Like " & txt & " Or 名称 Like " & txt & " Or 规格 Like " & txt & " Or 用途 Like " & txt & " Or 备注 Like " & txt End If
|
-- 作者:有点蓝 -- 发布时间:2022/8/29 20:50:00 -- txt = "\'%" & txt.replace("*","[*]").replace("%","[%]").replace("\'","\'\'") & "%\'" [此贴子已经被作者于2022/8/29 20:49:57编辑过]
|
-- 作者:王小风 -- 发布时间:2022/8/30 8:41:00 -- 感谢大佬 |