参考:http://www.foxtable.com/webhelp/topics/1453.htm
比如出入库明细表,datacolchanged
If e.DataCol.Name = "物料编码" Then
If e.NewValue Isnot Nothing Then
Dim dr As DataRow
dr = DataTables("表A).Find("[物料编码] = '" & e.NewValue & "'")
If dr Is Nothing
dr = DataTables("表A").addnew
dr("物料编码") = e.DataRow("物料编码")
dr("型号") = e.DataRow("型号")
dr("规格") = e.DataRow("规格")
dr("单价") = e.DataRow("单价")
End If
End If
End If