以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 二次筛选不包含的问题? (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=171766) |
-- 作者:2425004926 -- 发布时间:2021/9/8 18:37:00 -- 二次筛选不包含的问题? 经过第一列的初次筛选后,第二列在原基础上二次筛选, 如果不包含用 Filter & "[" & a.Text & "] Not Like \'" & "%" & c.Text & "%" & "\'" ,默认有空格就被过滤掉了,我想把有空格的可以筛选到,所以用下边的代码,红色表示,可是会出错,那么红色的代码应怎样改?请老师指点一下 Dim Filter As String 。。。 If Filter > "" ThenFilter = Filter & " And " Select Case b.Text Case "包含" filter = Filter & "[" & a.Text & "] Like \'" & "%" & c.Text & "%" & "\'" Case "不包含" filter = "(" & Filter & "[" & a.Text & "] Not Like \'" & "%" & c.Text & "%" & "\'" & ")" Or "(" & Filter & "[" & a.Text & "] Is Null" & ")" Case "不是" filter = filter & "(" & "[" & a.Text & "] <> \'" & c.Text & "\' Or [" & a.Text & "] Is Null" & ")"
|
-- 作者:有点蓝 -- 发布时间:2021/9/9 9:08:00 -- filter = Filter & "([" & a.Text & "] Not Like \'%" & c.Text & "%\' Or [" & a.Text & "] Is Null)" |
-- 作者:2425004926 -- 发布时间:2021/9/9 17:29:00 -- 好了!非常感谢!感谢!感谢! |