If e.DataCol.name = "是否调档完毕" ThenIf e.newvalue = Trueif DataTables("表B").find("身份证号='" & e.DataRow("身份证件号") & "'") isnot nothing then
DataTables("小学学籍库").deletefor("身份证号='" & e.DataRow("身份证件号") & "'")
DataTables("初中学籍库").deletefor("身份证号='" & e.DataRow("身份证件号") & "'")
DataTables("高中学籍库").deletefor("身份证号='" & e.DataRow("身份证件号") & "'")
else
Dim s As String
Select Case e.DataRow("学段")
Case "小学"
s = "小学学籍库"
Case "初中"
s = "初中学籍库"
Case "高中"
s = "高中学籍库"
Case Else
Return
End Select
Dim nma() As String = {"姓名","身份证号","学籍号","转入学校","年级","经办人","经办人电话"} 'A表数据来源列
Dim nmb() As String = {"学生姓名","身份证件号","学籍号","学校名称","年级","家庭成员姓名","联系电话"} 'B表数据接收列
Dim dr As DataRow = DataTables(s).AddNew
For i As Integer = 0 To nma.Length - 1
dr(nmb(i)) = e.DataRow(nma(i))
Next
endif
endifendif