以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  管理子表在增加行时 自动填充父表的某列内容  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=68550)

--  作者:yifan3429
--  发布时间:2015/5/20 11:05:00
--  管理子表在增加行时 自动填充父表的某列内容
管理子表在增加行时 自动填充父表的某列内容
e.DataRow("材质") = DataTables("订单.生产部.订单明细").DataCols("材质")  会有错误   求正解



--  作者:大红袍
--  发布时间:2015/5/20 11:06:00
--  

 

[此贴子已经被作者于2015/5/20 11:06:18编辑过]

--  作者:Bin
--  发布时间:2015/5/20 11:07:00
--  
e.DataRow("材质") = Tables("父表").Current("材质")
--  作者:大红袍
--  发布时间:2015/5/20 11:08:00
--  

e.DataRow("材质") = Tables("父表").Current("材质")

 

------

 

或者

 

Dim pdr As DataRow = e.DataRow.GetParentRow("父表")

If pdr IsNot Nothing Then

    e.DataRow("材质") = pdr("材质")

End If