以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  条件加载数据  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=119033)

--  作者:恒隆君
--  发布时间:2018/5/16 15:13:00
--  条件加载数据
只要输入一个条件
以下代码怎么不加载数据。

空白时,会加载所有数据的。

Dim nms() As String = {"S材料名称","S产品名称","S调配人","S调制墨名称","S机台编码","S机台名称","S墨桶编号"}
Dim sps() As String = {"\' ","\' ","\' ","\' ","\' ","\' ","\' "}
Dim bjf() As String = {" ="," = "," = "," = "," = "," = "," = "}
Dim fds() As String = {"材料信息","产品名称","调配人","调制墨名称","机台编码","机台名称","墨桶编号"}
Dim filter As String
For i As Integer = 0 To nms.Length - 1
    If e.Form.Controls(nms(i)).value IsNot Nothing Then
        If filter > " " Then
            filter = filter & " And "
        End If
        filter = filter & fds(i) & bjf(i) & sps(i) & e.Form.Controls(nms(i)).value & sps(i)
    End If
Next

DataTables("调制墨信息").LoadFilter = filter
DataTables("调制墨信息").Load()

--  作者:有点甜
--  发布时间:2018/5/16 15:16:00
--  

Dim nms() As String = {"S材料名称","S产品名称","S调配人","S调制墨名称","S机台编码","S机台名称","S墨桶编号"}
Dim sps() As String = {"\'","\'","\'","\'","\'","\'","\'"}
Dim bjf() As String = {" ="," = "," = "," = "," = "," = "," = "}
Dim fds() As String = {"材料信息","产品名称","调配人","调制墨名称","机台编码","机台名称","墨桶编号"}
Dim filter As String
For i As Integer = 0 To nms.Length - 1
    If e.Form.Controls(nms(i)).text <> Nothing Then
        If filter > "" Then
            filter = filter & " And "
        End If
        filter = filter & fds(i) & bjf(i) & sps(i) & e.Form.Controls(nms(i)).value & sps(i)
    End If
Next
msgbox(filter)
DataTables("调制墨信息").LoadFilter = filter
DataTables("调制墨信息").Load()