select case e.DataCol.Namecase "单位",“年级”,“部别”
If e.NewValue Is Nothing Then '如果新值是空白,也就是单位列的内容为空
e.DataRow("目标1") = Nothing '那么清空此行单位代码列的内容
Else
Dim dr As DataRow
'否则在产品表查找同名的产品行,将找到的行赋值给变量dr
dr = DataTables("校名设置").Find("[单位] = '" & e.DataRow(单位) & "' and [年级] = '" & e.DataRow(年级) & "' and [部别] = '" & e.DataRow(部别) & "'")
If dr IsNot Nothing Then '如果找到了同名的产品行,也就是dr不是Nothing
e.DataRow("目标1") = dr("目标1")
End If
End If
End If