Foxtable(狐表)用户栏目专家坐堂 → 窗口多值组合筛选(ok了)


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

主题:窗口多值组合筛选(ok了)

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/6/6 8:49:00 [显示全部帖子]


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/6/6 9:46:00 [显示全部帖子]

Dim Filter As String
With e.Form.Controls("型号")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Dim str As String = "1=2"
        For Each s As String In .Value.split(",")
            str &= " or 型号 like '%" & s & "%'"
        Next
        Filter = Filter & " (" & str & ") "
    End If
End With
With e.Form.Controls("规格1")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Dim str As String = "1=2"
        For Each s As String In .Value.split(",")
            str &= " or 规格 like '%" & s & "%'"
        Next
        Filter = Filter & " (" & str & ") "
    End If
End With
If Filter > "" Then
    Tables("表A").Filter = Filter
End If

With e.Form.Controls("规格1")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Dim str As String = "1=1"
        For Each s As String In .Value.split(",")
            str &= " and 规格 like '%" & s & "%'"
        Next
        Filter = Filter & " (" & str & ") "
    End If
End With


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/6/6 10:14:00 [显示全部帖子]


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/6/6 10:19:00 [显示全部帖子]

Dim Filter As String
With e.Form.Controls("型号")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Dim str As String = "1=2"
        For Each s As String In .Value.split(",")
            str &= " or 型号 like '%" & s & "%'"
        Next
        Filter = Filter & " (" & str & ") "
    End If
End With
Dim cmb As WinForm.CheckedComboBox
cmb = e.Sender
If filter = "" Then
    cmb.ComboList = DataTables("表A").GetComboListString("规格")
Else
    cmb.ComboList = DataTables("表A").GetComboListString("规格", filter)
End If

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/6/6 10:50:00 [显示全部帖子]

str &= " or 型号 like '%" & s & "%'"

 

改成

 

str &= " or (',' + 型号 + ',') like '%," & s & ",%'"


 回到顶部