以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 求教专家 窗口设计 筛选数据 出现问题 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=81023) |
-- 作者:tianzimens -- 发布时间:2016/2/16 17:39:00 -- 求教专家 窗口设计 筛选数据 出现问题 两个筛选条件同时选择,但是出现只有一个筛选条件的结果 如图 使用的代码: Dim Filter As String With e.Form.Controls("Brands") If .Value IsNot Nothing Then Filter = "品牌名称= \'" & .Value & "\'" End If End With With e.Form.Controls("Category") If .Value IsNot Nothing Then Filter = "品类_名称= \'" & .Value & "\'" End If End With If Filter > "" Then Tables("市场品牌统计表").Filter = Filter End If
|
-- 作者:大红袍 -- 发布时间:2016/2/16 18:26:00 -- Dim Filter As String = "1=1" With e.Form.Controls("Brands") If .Value IsNot Nothing Then Filter &= " and 品牌名称= \'" & .Value & "\'" End If End With With e.Form.Controls("Category") If .Value IsNot Nothing Then Filter &= " and 品类_名称= \'" & .Value & "\'" End If End With If Filter > "" Then Tables("市场品牌统计表").Filter = Filter End If |