既然有关联,在表B设置DataColChanged事件代码:
Select Case e.dataCol.Name
Case "交费日期"
Dim pr As DataRow = e.DataRow.GetParentRow("表A")
if pr IsNot Nothoing then
dim rq1 As date = pr("办理日期")
Dim rq2 As Date = e.Datarow(“交费日期”)
if rq1.Year = rq2.Year Then
e.datarow("用户类型") = “新用户”
Else
e.datarow("用户类型") = “往年用户”
End if
End Select
楼主可以看看这些例子:
http://www.foxtable.com/help/topics/2649.htm