A表代码:
If e.DataCol.Name = "产品编号" then
Dim dr as datarow = datatables("表B").find("产品编号= '" & e.NewValue & "'")
if dr is nothing then
dr = datatbles("表B").AddNew
dr("产品编号") = e.datarow("产品编号")
end if