是搜到这个帖子,http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=34628
模仿做的,功能都实现了,但是后续只要更改一下订单表的客户名,明细表的客户名会重新新增一行,不是在原有的单元格内更改的,
在订单表的 DataColChanged 增加了以下代码
If e.DataCol.Name = "编号" OrElse e.DataCol.Name = "客户名" Then
Dim dr As DataRow = DataTables("明细表").AddNew()
If e.DataRow.IsNull("编号") = False AndAlso e.DataRow.IsNull("客户名") = False Then
dr("编号") = e.DataRow("编号")
dr("客户名") = e.DataRow("客户名")
Else
dr("编号") = Nothing
dr("客户名") = Nothing
End If
End If
[此贴子已经被作者于2014-1-27 12:07:41编辑过]