学生情况表Select Case e.DataCol.Name
Case "当前状态"
Dim pr As DataRow
If e.OldValue > ""
pr = DataTables("状况统计").Find("当前状态 = '" & e.OldValue & "'")
If pr IsNot Nothing Then
DataTables("状况统计").DataCols("当前状态").RaiseDataColChanged(pr)
End If
End If
If e.NewValue > ""
pr = DataTables("状况统计").Find("当前状态 = '" & e.NewValue & "'")
If pr IsNot Nothing Then
DataTables("状况统计").DataCols("当前状态").RaiseDataColChanged(pr)
End If
End If
Case "年龄","建档立卡","本在本","本在外","补录"
Dim pr As DataRow
pr = DataTables("状况统计").Find("当前状态 = '" & e.DataRow("当前状态") & "'")
If pr IsNot Nothing Then
DataTables("状况统计").DataCols("当前状态").RaiseDataColChanged(pr)
End If
End Select
统计表
If e.DataCol.Name = "当前状态" Then
Dim Filter As String = "[当前状态] = '" & e.NewValue & "'"
e.DataRow("以下_建档") = DataTables("学生情况").Compute("count(姓名)", Filter & " and 年龄 < 16 and 建档立卡=true")
e.DataRow("以上_补录") = DataTables("学生情况").Compute("count(姓名)", Filter & " and 年龄 >= 16 and 补录='补录'")
End If