以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  在后台提取  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=110987)

--  作者:有点甜
--  发布时间:2017/12/13 14:39:00
--  
Dim Filter As String
With e.Form.Controls("姓名1")
    If .Value IsNot Nothing Then
        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
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
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
e.Form.controls("生产报工查询表").Table.DataTable.LoadFilter = Filter
e.Form.controls("生产报工查询表").Table.DataTable.Load

--  作者:有点甜
--  发布时间:2017/12/13 16:29:00
--  

改成这样

 

msgbox(filter)

e.Form.controls("生产报工查询表").Table.DataTable.LoadPage = 0

e.Form.controls("生产报工查询表").Table.DataTable.LoadTop = ""

e.Form.controls("生产报工查询表").Table.DataTable.LoadFilter = Filter
e.Form.controls("生产报工查询表").Table.DataTable.Load