以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  查询  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=170533)

--  作者:qazlinle6
--  发布时间:2021/7/29 17:19:00
--  查询
Dim Filter As String
With e.Form.Controls("店名")
    If .Value IsNot Nothing Then
        Filter = " \'," & .Value & ",\' like \'%,\' +店名汉字+\',%\'"
    End If
End With
With e.Form.Controls("对账品名")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = " \'," & .Value & ",\' like \'%,\' +对账品名+\',%\'"
    End If
End With
With e.Form.Controls("对账品类")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = " \'," & .Value & ",\' like \'%,\' +对账品类+\',%\'"
    End If
End With
With e.Form.Controls("年")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "年 = \'" & .Value & "\'"
    End If
End With
With e.Form.Controls("月")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "月 = \'" & .Value & "\'"
    End If
End With
If Filter > "" Then
    DataTables("盘点明细").LoadFilter = Filter
    DataTables("盘点明细").Load()
End If



店名单值,对账品名填入值,查询会查岀全部店名

--  作者:有点蓝
--  发布时间:2021/7/29 17:22:00
--  
Filter = Filter & " \'," & .Value & ",\' like \'%,\' +对账品名+\',%\'"