Dim t1 As Table = e.Form.Controls("Table1").Table Dim t2 As Table = e.Form.Controls("Table2").Table For Each r As Row In t1.Rows r("总件数") = r.DataRow.GetChildRows("第一类履历材料").Count r("总页数") = t2.DataTable.Compute("sum(页数)","档案编号 = '" & r("档案编号") & "'") Next