Foxtable(狐表)用户栏目专家坐堂 → 筛选异常


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

主题:筛选异常

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


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

Dim Filter As String = "1=1"
With e.Form.Controls("客户编码1")
    If .Value IsNot Nothing Then
        Filter &= " and 客户编码 = '" & .Value & "'"
    End If
End With
With e.Form.Controls("成品编码1")
    If .Value IsNot Nothing Then
        Filter &= " and 成品编码 = '" & .Value & "'"
    End If
End With
With e.Form.Controls("材料描述1")
    If .Value IsNot Nothing Then
        Filter = Filter & " and 材料描述 like '%" & .Value & "%'"
    End If
End With
With e.Form.Controls("材料编码1")
    If .Value IsNot Nothing Then
        Filter &= " and 材料编码 = '" & .Value & "'"
    End If
End With
With e.Form.Controls("成品描述1")
    If .Value IsNot Nothing Then
        Filter = Filter & " and 成品描述 like '%" & .Value & "%'"
    End If
End With
With e.Form.Controls("开始日期1")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "要求交货日期>= '" & .Value & "'"
    End If
End With
With e.Form.Controls("结束日期1")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "要求交货日期 <= '" & .Value & "'"
    End If
End With
With e.Form.Controls("业务员1")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "业务员= '"  & .Value & "'"
    End If
End With
With e.Form.Controls("销售订单号1")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "销售订单号 = '"  & .Value & "'"
    End If
End With
msgbox(filter)
e.Form.controls("发货明细").Table.DataTable.LoadPage = 0
e.Form.controls("发货明细").Table.DataTable.LoadFilter = "[发货状态] = '进行中' and " & filter
e.Form.controls("发货明细").Table.DataTable.Load
DataTables("包装箱出库_发货明细").DataCols("材料编码").RaiseDataColChanged()
DataTables("包装箱出库_发货明细").DataCols("已包未发").RaiseDataColChanged()
DataTables("包装箱出库_发货明细").DataCols("需求数量").RaiseDataColChanged()
[此贴子已经被作者于2019/3/4 9:56:55编辑过]

 回到顶部