参考:
http://www.foxtable.com/webhelp/topics/1451.htm
可以先查询需要同步的表,如果没有这个订单号,可以先新增,有就直接更新,比如
If e.DataCol.Name = "产品编号" Then
Dim nms() As String = {"品名","型号","规格","单价"}
If e.NewValue Is Nothing Then
For Each nm As String In nms
e.DataRow(nm) = Nothing
Next
Else
Dim dr As DataRow
dr = DataTables("产品").Find("[产品编号] = '" & e.NewValue & "'")
If dr Is Nothing
dr = DataTables("产品").addnew
dr("产品编号") = e.NewValue
End If
For Each nm As String In nms
e.DataRow(nm) = dr(nm)
Next
End If
End If