Foxtable(狐表)用户栏目专家坐堂 → 筛选的代码求帮助


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

主题:筛选的代码求帮助

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


加好友 发短信
等级:超级版主 帖子:107680 积分:547721 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2018/11/19 21:51:00 [显示全部帖子]

参考:http://www.foxtable.com/webhelp/scr/1058.htm

Dim Filter As String
With e.Form.Controls("仓库")
    If .Value IsNot Nothing Then
        Filter = "仓库属性 = '" & .Value & "'"
    End If
End With

With e.Form.Controls("TextBox1")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Dim txt As String = "'%" & .txt & "%'"
        Filter = Filter & "(商品ID Like " & txt & " Or 商品名称 Like " & txt & "  Or 拼音码 Like " & txt  & ")"
    End If
End With
Tables("产品").Filter  = Filter 

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


加好友 发短信
等级:超级版主 帖子:107680 积分:547721 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2018/11/19 22:24:00 [显示全部帖子]

Dim Filter As String
With e.Form.Controls("仓库")
    If .Value IsNot Nothing Then
        Filter = "仓库 = '" & .Value & "'"
    End If
End With

With e.Form.Controls("TextBox1")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Dim txt As String = "'%" & .txt & "%'"
        Filter = Filter & "(商品ID Like " & txt & " Or 商品名称 Like " & txt & "  Or 拼音码 Like " & txt  & ")"
    End If
End With
Tables("产品").Filter  = Filter


 回到顶部