以文本方式查看主题
- Foxtable(狐表) (http://foxtable.com/bbs/index.asp)
-- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2)
---- [求助]筛选 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=54113)
|
-- 作者:青岛立邦达
-- 发布时间:2014/7/22 10:45:00
-- [求助]筛选
此主题相关图片如下:qq图片20140722103715.jpg
想做这样一个总筛选,但是没有思路。
|
-- 作者:有点甜
-- 发布时间:2014/7/22 10:46:00
--
参考
http://www.foxtable.com/help/topics/1058.htm
|
-- 作者:Bin
-- 发布时间:2014/7/22 10:47:00
--
http://www.foxtable.com/help/topics/1058.htm
|
-- 作者:青岛立邦达
-- 发布时间:2014/7/22 13:37:00
--
这个代码无效,是不是漏了什么?
Dim Filter As String With e.Form.Controls("cmbProduct") If .Value IsNot Nothing Then Filter = "型号 = \'" & .Value & "\'" End If End With With e.Form.Controls("cmbCustomer") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "客户 = \'" & .Value & "\'" End If End With With e.Form.Controls("cmbEmployee") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "维修员 = \'" & .Value & "\'" End If End With With e.Form.Controls("textbox1") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "序列号 = \'" & .Value & "\'" End If End With With e.Form.Controls("comboBox1") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "修品类别 = \'" & .Value & "\'" End If End With With e.Form.Controls("StartDate") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "接修日期 >= #" & .Value & "#" End If End With With e.Form.Controls("EndDate") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "维修完成时间 <= #" & .Value & "#" End If End With If Filter > "" Then Tables("检测维修单").Filter = Filter End If
此主题相关图片如下:qq图片20140722133551.jpg
|
-- 作者:青岛立邦达
-- 发布时间:2014/7/22 14:04:00
--
版主们来看看捏
|
-- 作者:Bin
-- 发布时间:2014/7/22 14:08:00
--
你用的是窗口副本表,但是你代码筛选的是主表,当然没反应
改为
Tables("检测维修单_Table1").Filter = Filter
|
-- 作者:青岛立邦达
-- 发布时间:2014/7/22 14:16:00
--
好用了,但是做不到关键字筛选,比如维修员是 鲍圣 得全打上, 打个鲍就出不来,怎么能做到模糊筛选呢
|
-- 作者:Bin
-- 发布时间:2014/7/22 14:17:00
--
把 = 换为LIke
例如(字符串列才可以这么做) Filter = Filter & "序列号 like \'*" & .Value & "*\'"
日期列可不能这么做哦
数值列可以转换一下 Filter = Filter & "Conevert([序列号],\'System.String\') like \'*" & .Value & "*\'"
[此贴子已经被作者于2014-7-22 14:17:42编辑过]
|