以文本方式查看主题

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

--  作者:有点蓝
--  发布时间:2019/9/12 15:25:00
--  
参考: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