以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [讨论]查询的问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=125415)

--  作者:manyifuwu
--  发布时间:2018/9/27 21:26:00
--  [讨论]查询的问题

Dim Filter As String
With e.Form.Controls("ComboBox1")
    If .Value IsNot Nothing Then
        Filter = Filter & "时间 like \'%" & .Value & "%\'"
    End If
End With
With e.Form.Controls("cmbProduct")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "部门 like \'%" & .Value & "%\'"
    End If
End With

With e.Form.Controls("DateTimePicker1")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "截止日期 >= \'" & .Value & "\'"
    End If
End With
With e.Form.Controls("DateTimePicker1")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "截止日期 <= \'" & .Value & "\'"
    End If
End With

\'     Tables("派工").Filter &= " and 交单 <> \'取消\'"    派工表有《交单列》,筛选时不显示   交单列 包含取消的取消的行

If Filter > "" Then
    DataTables("派工").LoadFilter = Filter
    DataTables("派工").Load()
End If

 

 

 派工表有《交单列》,筛选时 不显示   交单列 包含取消的取消的行


--  作者:有点甜
--  发布时间:2018/9/27 21:38:00
--  
Tables("派工").Filter = Filter & " and (交单 is null or 交单 not like \'%取消%\')"