以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 删选 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=172265) |
||||
-- 作者:11112 -- 发布时间:2021/10/4 17:16:00 -- 删选 老师您好我筛选的textbox1好像有点问题,可以帮我看一下吗,感觉两边的关键字筛选也有点问题
|
||||
-- 作者:有点蓝 -- 发布时间:2021/10/4 21:56:00 -- 要实现什么样的逻辑,请使用文字说明 |
||||
-- 作者:11112 -- 发布时间:2021/10/5 8:55:00 -- 老师我要的效果是开始 结束....关键字 是并集的然后呢 开始1 结束1 关键字1.。。。。是并集 就是and ,然后两者条件满足的时候是交集的,就好像这个Tables("主控窗口_Table2").Filter = "(" & Filter & ") or (" & Filter2 & ")" |
||||
-- 作者:有点蓝 -- 发布时间:2021/10/7 8:52:00 -- Dim Filter As String With e.Form.Controls("开始") If .Value IsNot Nothing Then 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 Dim txt1 As String = e.Form.Controls("TextBox1").Text Dim tb1 As Table = Tables("主控窗口_Table2") Dim f1 As String = Filter Dim Values() As String Values = txt1.split(",") For Index As Integer = 0 To Values.Length - 1 If f1 > "" Then f1= f1 & " and " Dim txt As String =Values(Index) txt = "\'%" & txt & "%\'" f1= f1 & "(店铺名称 Like " & txt & " Or 单号 Like " & txt & " Or 处理人 Like " & txt & " Or 发货仓库 Like" & txt & " Or 物流公司 Like" & txt & " Or 赠送SKU Like" & txt & " Or 客户姓名 Like" & txt & " Or 系统单号 Like" & txt & " Or 产品类别 Like " & txt & " Or 配件SKU Like " & txt & " Or 产品SKU Like " & txt & " Or 联系方式 Like " & txt & " Or 追踪号 Like " & txt & " Or 处理方式 Like " & txt & " Or 备注 Like " & txt & " Or 回访 Like" & txt & " Or 状态 Like" & txt & " Or 寄送地址 Like " & txt & " Or [状况描述 原因] Like " & txt & ")" Next Dim Filter2 As String With e.Form.Controls("开始2") If .Value IsNot Nothing Then Filter2 = Filter2 & "记录时间 >= #" & .Value & "#" End If End With …… With e.Form.Controls("处理人2") If .Value IsNot Nothing Then If Filter2 >"" Then Filter2 = Filter2 & " And " End If Filter2 = Filter2 & "处理人 = \'" & .Value & "\'" End If End With Dim txt2 As String = e.Form.Controls("TextBox6").Text Dim tb2 As Table = Tables("主控窗口_Table2") Dim f3 As String = Filter2 Dim Values() As String Values = txt2.split(",") For Index As Integer = 0 To Values.Length - 1 If f3 > "" Then f3= f3 & " and " Dim txt As String =Values(Index) txt = "\'%" & txt & "%\'" f3= f3 & "(店铺名称 Like " & txt & " Or 单号 Like " & txt & " Or 处理人 Like " & txt & " Or 发货仓库 Like" & txt & " Or 物流公司 Like" & txt & " Or 赠送SKU Like" & txt & " Or 客户姓名 Like" & txt & " Or 系统单号 Like" & txt & " Or 产品类别 Like " & txt & " Or 配件SKU Like " & txt & " Or 产品SKU Like " & txt & " Or 联系方式 Like " & txt & " Or 追踪号 Like " & txt & " Or 处理方式 Like " & txt & " Or 备注 Like " & txt & " Or 回访 Like" & txt & " Or 状态 Like" & txt & " Or 寄送地址 Like " & txt & " Or [状况描述 原因] Like " & txt & ")" Next If f1 > "" AndAlso f3 > "" Then Tables("主控窗口_Table2").Filter = "(" & f1 & ") or (" & f3 & ")" Else If f1 > "" Then Tables("主控窗口_Table2").Filter = f1 ElseIf f3> "" Then Tables("主控窗口_Table2").Filter = f3 else Tables("主控窗口_Table2").Filter = "" End If End If
[此贴子已经被作者于2021/10/7 11:11:51编辑过]
|
||||
-- 作者:11112 -- 发布时间:2021/10/7 11:01:00 -- 此主题相关图片如下:wechat 圖片_20211007105942.png 老师现在关键字报错这个,老师麻烦帮我看一下 Filter2关键字那里
|
||||
-- 作者:有点蓝 -- 发布时间:2021/10/7 11:13:00 -- 重新看4楼 |
||||
-- 作者:11112 -- 发布时间:2021/10/7 11:29:00 -- 老师用四楼的代码1.单条查询没有反应,2.With e.Form.Controls("店铺名称") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "店铺名称 = \'" & .Value & "\'" End If End With 这些都删选不了,只能筛选关键字了现在,而且关键字也只能筛选两者并集
|
||||
-- 作者:11112 -- 发布时间:2021/10/7 11:31:00 -- Dim txt2 As String = e.Form.Controls("TextBox6").Text Dim tb2 As Table = Tables("主控窗口_Table2") Dim f3 As String = Filter2 If Filter2 > "" Then If f3>"" Then f3 = "(" & f3 & ") and (" & Filter2 & ")" Else f3 = Filter2 End If End If Dim Values1() As String Values1 = txt2.split(",") For Index As Integer = 0 To Values1.Length - 1 If f3 > "" Then f3= f3 & " and " Dim txt As String =Values1(Index) txt = "\'%" & txt & "%\'" Filter2= f3 & "(店铺名称 Like " & txt & " Or 单号 Like " & txt & " Or 处理人 Like " & txt & " Or 发货仓库 Like" & txt & " Or 物流公司 Like" & txt & " Or 赠送SKU Like" & txt & " Or 客户姓名 Like" & txt & " Or 系统单号 Like" & txt & " Or 产品类别 Like " & txt & " Or 配件SKU Like " & txt & " Or 产品SKU Like " & txt & " Or 联系方式 Like " & txt & " Or 追踪号 Like " & txt & " Or 处理方式 Like " & txt & " Or 备注 Like " & txt & " Or 回访 Like" & txt & " Or 状态 Like" & txt & " Or 寄送地址 Like " & txt & " Or [状况描述 原因] Like " & txt & ")" Next If Filter > "" AndAlso Filter2 > "" Then Tables("主控窗口_Table2").Filter = "(" & Filter & ") and (" & Filter2 & ")" Else If Filter > "" Then Tables("主控窗口_Table2").Filter = Filter ElseIf Filter2> "" Then Tables("主控窗口_Table2").Filter = Filter2 End If End If 把她改成这个只能筛选一个关键字,多个就报错
|
||||
-- 作者:有点蓝 -- 发布时间:2021/10/7 11:33:00 -- 在认真看看4楼。搞不定就上传实例 [此贴子已经被作者于2021/10/7 11:32:54编辑过]
|
||||
-- 作者:11112 -- 发布时间:2021/10/7 11:47:00 -- 老师帮我看一下把,我真的不是很懂 |