If e.DataCol.Name = "产品图号" Then
If e.NewValue Is Nothing Then
e.DataRow("库房保管员") = Nothing
e.DataRow("车间名称") = Nothing
e.DataRow("产品名称") = Nothing
e.DataRow("销售保管员") = Nothing
Else
Dim dr As DataRow
dr = DataTables("车间入库数量统计表").Find("产品图号 = '" & e.DataRow("产品图号") & "' and 库房保管员 is not null")
If dr IsNot Nothing
e.DataRow("库房保管员") = dr("库房保管员")
End If
dr = DataTables("车间入库数量统计表").Find("产品图号 = '" & e.DataRow("产品图号") & "' and 车间名称 is not null")
If dr IsNot Nothing
e.DataRow("车间名称") = dr("车间名称")
End If
dr = DataTables("车间入库数量统计表").Find("产品图号 = '" & e.DataRow("产品图号") & "' and 产品名称 is not null")
If dr IsNot Nothing
e.DataRow("产品名称") = dr("产品名称")
End If
dr = DataTables("销售入库数量统计表").Find("产品图号 = '" & e.DataRow("产品图号") & "' and 销售保管员 is not null")
If dr IsNot Nothing
e.DataRow("销售保管员") = dr("销售保管员")
End If
End If
End If
不过感觉这样很不妥,比如一个图号下如果有多个生产车间就会有问题。