以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 筛选条件 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=68567) |
-- 作者:一笑 -- 发布时间:2015/5/20 15:22:00 -- 筛选条件 原代码运行正常,如下: Dim Filter As String With e.Form.Controls("性质") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "性质 = \'" & .Value & "\'" End If End With With e.Form.Controls("开始") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "飞行日期 >= #" & .Value & "#" End If End With If Filter > "" Then Tables("事件统计_Table1").Filter = Filter End If 想增加一个筛选条件:事件的性质为“严重\' 或轻度",最后一句我写成:b.Filter = Filter & "And 性质 = \'严重\' or 性质 = \'轻度\'",报错。 应该加在哪儿?谢谢 |
-- 作者:Bin -- 发布时间:2015/5/20 15:26:00 -- b.Filter = Filter & " And (性质 = \'严重\' or 性质 = \'轻度\')" |