第一个问题,学生基本信息表的DataColChanged加上一段代码:
If e.DataCol.Name = "变动原因" Then
If e.DataRow("变动原因") = "毕业" OrElse e.DataRow("变动原因") = "转学" Then
Dim dr As DataRow = DataTables("毕业转学").Addnew
For Each dc As DataCol In DataTables("毕业转学").DataCols
dr(dc.name) = e.DataRow(dc.name)
Next
e.DataRow.Delete
End If
End If
第二个问题,统计班数:
e.DataRow("班级数统计_班数") = DataTables("学生基本信息").GetUniqueValues("[年级]= '" & e.DataRow("年级统计_年级") & "'", "班级").Count
其他统计用类似的方法。