以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  多值加载  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=169692)

--  作者:qazlinle6
--  发布时间:2021/6/26 11:46:00
--  多值加载
Dim Filter As String
With e.Form.Controls("店名")
    If .Value IsNot Nothing Then
        Filter = " \',\'+店名汉字+\',\' like \'%," & .Value & ",%\'"
    End If
End With



窗口店名有1,2,3,4,5    表什么加载不岀东西,只有单独选1才加载的了

--  作者:有点蓝
--  发布时间:2021/6/26 12:07:00
--  
请上传实例说明
--  作者:qazlinle6
--  发布时间:2021/6/26 14:12:00
--  

图片点击可在新窗口打开查看此主题相关图片如下:qq浏览器截图20210626141342.png
图片点击可在新窗口打开查看


Dim Filter As String
With e.Form.Controls("店名")
    If .Value IsNot Nothing Then
        Filter = " \',\'+店名汉字+\',\' like \'%," & .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
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
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

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/6/26 14:14:42编辑过]

--  作者:有点蓝
--  发布时间:2021/6/26 14:52:00
--  
Filter = " \'," & .Value & ",\' like \'%,\' +店名汉字+\',%\'"
--  作者:qazlinle6
--  发布时间:2021/6/26 15:48:00
--  

图片点击可在新窗口打开查看此主题相关图片如下:qq浏览器截图20210626141342.png
图片点击可在新窗口打开查看


Dim cmb As WinForm.ComboBox = e.Sender
Dim str As String = e.Form.Controls("店名").Value
Dim str1 As String = e.Form.Controls("开始日期").Value
Dim str2 As String = e.Form.Controls("结束日期").Value
cmb.ComboList = DataTables("进货退货").SQLGetComboListString("对账品名", "  \',\'+店名汉字+\',\' like \'%," & str & ",%\'      And 日期>= \'" & str1 & "\' And  日期<= \'" & str2 & "\'")


店名单值对账品名才可以取值,多值取值就没内容





[此贴子已经被作者于2021/6/26 15:49:07编辑过]

--  作者:有点蓝
--  发布时间:2021/6/26 15:52:00
--  
Dim cmb As WinForm.ComboBox = e.Sender
Dim str As String = e.Form.Controls("店名").Value
Dim str1 As date = e.Form.Controls("开始日期").Value
Dim str2 As date = e.Form.Controls("结束日期").Value
cmb.ComboList = DataTables("进货退货").SQLGetComboListString("对账品名", "\'," & str & ",\' like \'%,\' +店名汉字+\',%\'     And 日期>= \'" & str1 & "\' And  日期<= \'" & str2 & "\'")