If e.DataCol.Name = "计划单编号" Then
Dim nms() As String = {"机械名称","机械编号","任务单编号"}
If e.NewValue Is Nothing Then
For Each nm As String In nms
e.DataRow(nm) = Nothing
Next
Else
Dim dr As DataRow
dr = DataTables("材料申购明细表").Find("[计划单编号] =
\'" & e.NewValue & "\'")
If dr IsNot Nothing
For Each nm As String In nms
e.DataRow(nm) = dr(nm)
Next
End If
End If
End If
Dim dr
As DataRow =
e.DataRow
Select Case e.DataCol.Name
Case "单价","调拨","采购"
If e.DataRow("调整")
= False Then
dr("金额")
= dr("单价")
* (dr("调拨")
+ dr("采购"))
End If
Case "金额"
e.DataRow("调整") = dr("金额") <> dr("单价") * (dr("调拨") + dr("采购"))
End Select
Next
此主题相关图片如下:qq截图20150709222639.png