以文本方式查看主题

-  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=72383)

--  作者:hnpykfq123
--  发布时间:2015/7/29 16:28:00
--  跨表引用下列代码为何无效?
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("产品表").find("[产品名称]=\'" & e.newvalue &"\'")
   If dr IsNot Nothing Then
   For Each nm As String In nms
   e.DataRow(nm)=dr(nm)
Next
End If
End If
End If

--  作者:大红袍
--  发布时间:2015/7/29 16:42:00
--  

这句,是不是要改成产品编号?

 

dr= DataTables("产品表").find("[产品名称]=\'" & e.newvalue &"\'")


--  作者:hnpykfq123
--  发布时间:2015/7/29 17:25:00
--  太感谢!
测试成功!
太感谢了,你真是厉害!