If e.DataCol.Name = "项目编号" Then
Dim dr As DataRow
dr = DataTables("表A").Find("档案编号= '" & e.DataRow("项目编号") & "'" )
Tables("表B").AddNew() '新建行
Tables("表B").position = Tables("表B").Rows.Count-1 '跳到最后一行
If dr IsNot Nothing '如果找到, 则设置各列内容
e.DataRow("项目编号")= dr("档案编号")
Dim ndb As DataRow = DataTables("表B").AddNew
ndb("时间编号") = Format(Date.Now, "yyyyMMddHHmmss") '变动日期编号
End If
End If '当表B的项目编号列未找到与表A的档案编号有相同时,新建行,选中新建行,将表A档案编号复制到项目编号,时间编号得到时间编号,
If e.DataCol.Name = "项目编号" Then
Dim dr As DataRow
dr = DataTables("表A").Find("档案编号= '" & e.DataRow("项目编号") & "' and 状态=学习中" )
Dim r As Row = e.Table.Current
If r IsNot Nothing Then
Tables("表B").Position = Tables("表A").FindRow("档案编号")
End If '窗口表与表格同步
End If
End If '当表B的项目编号列找到与表A的档案编号有相同时,同时表B的状态列有学习中,则选中改行,
If e.DataCol.Name = "项目编号" Then
Dim dr As DataRow
dr = DataTables("表A").Find("档案编号= '" & e.DataRow("项目编号") & "' and 状态=已学习" )
Tables("表B").AddNew() '新建行
Tables("表B").position = Tables("表B").Rows.Count-1 '跳到最后一行
If dr IsNot Nothing '如果找到, 则设置各列内容
e.DataRow("项目编号")= dr("档案编号")
Dim nda As DataRow = DataTables("表B").AddNew
nda("时间编号") = Format(Date.Now, "yyyyMMddHHmmss") '变动日期编号
End If
End If '当表B的项目编号列找到与表A的档案编号有相同时,同时表B的状态列有都是已学习,新建行,选中新建行,将表A档案编号复制到项目编号,时间编号得到时间编号,