以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  表达式引用数据  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=126823)

--  作者:foxuser
--  发布时间:2018/10/29 18:00:00
--  表达式引用数据
A表批号、米数、重量列,B表批号(表达式列)、米数、重量 ,以下代码引用不了
代码:If e.DataCol.Name = "批号" Then
    Dim nms() As String = {"米数","重量"}
    If e.NewValue Is Nothing Then 
        For Each nm As String In nms 
            e.DataRow(nm) = Nothing 
        Next 
    Else 
        Dim dr As DataRow 
        dr = DataTables("A表").Find("[批号] = \'" & e.NewValue & "\'") 
        If dr IsNot Nothing
            For Each nm As String In nms
                e.DataRow(nm) = dr(nm)
            Next
        End If
    End If
End If

--  作者:有点甜
--  发布时间:2018/10/29 18:22:00
--  

看看

 

http://www.foxtable.com/webhelp/scr/2381.htm