以文本方式查看主题
- Foxtable(狐表) (http://foxtable.net/bbs/index.asp)
-- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2)
---- 关于数据筛选 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=103093)
|
-- 作者:peibaomin
-- 发布时间:2017/6/30 13:33:00
-- 关于数据筛选
Dim Filter As String With e.Form.Controls("leixingComboBox") If .Value IsNot Nothing Then Filter = "类型= \'" & .Value & "\'" End If End With If e.Form.Controls("yibangding").Checked = True \' 如果客户绑定状态选择了"已绑定" If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "是否绑定= True" End If If e.Form.Controls("weibangding").Checked = True \' 如果客户绑定状态选择了"未绑定" If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "是否绑定 = False Or 是否绑定 Is Null" End If If e.Form.Controls("yiguoqi").Checked = True \' 如果是否过期状态选择了"已过期" If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "是否过期= True" End If If e.Form.Controls("weiguoqi").Checked = True \' 如果是否过期状态选择了"未过期" If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "是否过期 = False Or 是否过期 Is Null" End If If e.Form.Controls("keyixufei").Checked = True \' 如果续费状态选择了"已续费" If Filter >"" The Filter = Filter & " And " End If Filter = Filter & "是否可以续费= True" End If If e.Form.Controls("bukexufei").Checked = True \' 如果续费状态选择了"未续费" If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "是否可以续费 = False Or 是否可以续费 Is Null" End If If Filter > "" Then Tables("流量卡资料").Filter = Filter End If e.Form.Controls("shaixuanhou").text = Tables("流量卡资料").Rows.Count & " 张流量卡"
字段代码有问题吗?怎么运行时,无法查找?
此主题相关图片如下:llk.png
[此贴子已经被作者于2017/6/30 13:36:56编辑过]
|
-- 作者:有点甜
-- 发布时间:2017/6/30 14:32:00
--
Dim Filter As String With e.Form.Controls("leixingComboBox") If .Value IsNot Nothing Then Filter = "类型= \'" & .Value & "\'" End If End With If e.Form.Controls("yibangding").Checked = True \' 如果客户绑定状态选择了"已绑定" If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "是否绑定= True" End If If e.Form.Controls("weibangding").Checked = True \' 如果客户绑定状态选择了"未绑定" If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "(是否绑定 = False Or 是否绑定 Is Null)" End If If e.Form.Controls("yiguoqi").Checked = True \' 如果是否过期状态选择了"已过期" If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "是否过期= True" End If If e.Form.Controls("weiguoqi").Checked = True \' 如果是否过期状态选择了"未过期" If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "(是否过期 = False Or 是否过期 Is Null)" End If If e.Form.Controls("keyixufei").Checked = True \' 如果续费状态选择了"已续费" If Filter >"" The Filter = Filter & " And " End If Filter = Filter & "是否可以续费= True" End If If e.Form.Controls("bukexufei").Checked = True \' 如果续费状态选择了"未续费" If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "(是否可以续费 = False Or 是否可以续费 Is Null)" End If If Filter > "" Then Tables("流量卡资料").Filter = Filter End If e.Form.Controls("shaixuanhou").text = Tables("流量卡资料").Rows.Count & " 张流量卡"
|
-- 作者:peibaomin
-- 发布时间:2017/6/30 15:31:00
--
有点甜老师!单击所有的“全部”按钮不管用
[此贴子已经被作者于2017/6/30 15:41:13编辑过]
|
-- 作者:peibaomin
-- 发布时间:2017/6/30 16:17:00
--
有点甜老师!单击所有的“全部”按钮不管用
|
-- 作者:有点蓝
-- 发布时间:2017/6/30 16:56:00
--
最后弹出筛选条件看看
msgbox(Filter)
|
-- 作者:裴保民
-- 发布时间:2017/6/30 16:59:00
--
怎么选择‘’全部‘’单选框后再单击筛选按钮结果不管用
|
-- 作者:裴保民
-- 发布时间:2017/6/30 17:14:00
--
有点蓝老师按了没反应!您再看看代码有错吗?
|
-- 作者:有点甜
-- 发布时间:2017/6/30 17:15:00
--
以下是引用裴保民在2017/6/30 16:59:00的发言: 怎么选择‘’全部‘’单选框后再单击筛选按钮结果不管用
最后你的代码是怎么写的?2楼的代码,不应该有问题的。全部肯定能筛选出来。
|
-- 作者:peibaomin
-- 发布时间:2017/6/30 20:17:00
--
如果“类型”为空值,绑定状态选已绑定或未绑定可以更新数据,可是再次选择全部时数据不更新!除非类型字段选择不为空时,再选择绑定字段为全部数值时数据才更新。下边的字段也一样 用msgbox(Filter)返回码是: 此主题相关图片如下:sx.png
[此贴子已经被作者于2017/6/30 20:21:26编辑过]
|
-- 作者:有点蓝
-- 发布时间:2017/6/30 21:05:00
--
If Filter > "" Then Tables("流量卡资料").Filter = Filter End If
去掉外层的if,改成
Tables("流量卡资料").Filter = Filter
|