'表ADataColChanged事件代码 Dim dt As DataTable = DataTables("表B") Dim dr As DataRow = e.DataRow Dim str As String = "图号 = '" & dr("图号") & "' And 序号 = '" & dr("序号") & "' And 状态 = '执行'" if e.DataCol.Name = "图号" OrElse e.DataCol.Name = "序号" Then Dim r As DataRow = dt.Find(str) if r IsNot Nothing Then dr ("准结") = dt.Compute("Sum(准结1)",str) + dt.Compute("Sum(准结2)",str) + dt.Compute("Sum(准结3)",str) dr("加工") = dt.Compute("Sum(加工)",str) End If End If
|