If e.DataCol.Name = "工单单号" Then
If e.NewValue Is Nothing Then
e.DataRow("余料检查") = Nothing
Else
Dim dr As DataRow
dr = DataTables("生产入库单").Find("[来源单号] = \'" & e.NewValue & "\' and 余料检查 is not null")
If dr IsNot Nothing
e.DataRow("余料检查") = "检查"
else
e.DataRow("余料检查") = Nothing
End If
End If
End If