参考:
http://www.foxtable.com/webhelp/scr/1472.htm
B表DataColChanged事件
If e.DataCol.Name = "产品" orelse e.DataCol.Name = "日期" Then
Dim Filter As String = "[产品] = '" & e.DataRow("产品") & "' and [日期] = '" & e.DataRow("日期") & "'"
e.DataRow("金额") = DataTables("A表").Compute("Sum(金额)", Filter)
End If
A表DataColChanged事件
Select Case e.DataCol.Name
Case "产品","日期","金额"
Dim pr As DataRow
pr = DataTables("B表").Find("产品 = '" & e.DataRow("产品") & "' and [日期] = '" & e.DataRow("日期") & "'")
If pr IsNot Nothing Then
DataTables("B表").DataCols("产品").RaiseDataColChanged(pr)
End If
End Select