Foxtable(狐表)用户栏目专家坐堂 → 双层排序


  共有3291人关注过本帖树形打印复制链接

主题:双层排序

帅哥哟,离线,有人找我吗?
aaa1234
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:825 积分:1650 威望:0 精华:0 注册:2021/7/30 8:48:00
双层排序  发帖心情 Post By:2021/9/8 9:33: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
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
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("Table_3").Filter = Filter
End If

 回到顶部
帅哥哟,离线,有人找我吗?
aaa1234
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:825 积分:1650 威望:0 精华:0 注册:2021/7/30 8:48:00
  发帖心情 Post By:2021/9/8 9:34:00 [只看该作者]

这是我的关键字筛选TextChangedDim txt As String = e.Form.Controls("TextBox1").Text
Dim tbl As Table = Tables("Table_3")
If txt = "" Then
    tbl.Filter = ""
Else
    txt = "'%" & txt & "%'"
    tbl.Filter = "店铺名称 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   
End If
可不可以就是说两个结合,就是同时筛选跟关键字筛选
[此贴子已经被作者于2021/9/8 9:58:13编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110592 积分:562856 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/9/8 10:01:00 [只看该作者]

……
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 txt As String = e.Form.Controls("TextBox1").Text
If txt > "" Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
    txt = "'%" & txt & "%'"
    Filter  =  Filter  & "(店铺名称 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 & ")"  
End If
If Filter > "" Then
    Tables("Table_3").Filter = Filter
End If

 回到顶部