单个克重列默认值公式设为2
Dim dr As DataRow = e.DataRow
Select Case e.DataCol.Name
Case "入库数量1","入库数量","单个克重"
If dr.IsNull("入库数量") OrElse dr.IsNull("单个克重") Then
dr("入库数量1") = Nothing
Else
dr("入库数量1") = dr("入库数量") * dr("单个克重")
End If
End Select
If e.DataCol.Name = "材料名" Then
Dim dr1 As DataRow = DataTables("入录资料").Find("原材料 = " & "'" & e.DataRow("材料名") & "'" )
If dr1 IsNot Nothing
e.DataRow("材料代号")= dr1("代号")
e.DataRow("单位")= dr1("单位")
e.DataRow("规格")= dr1("规格")
e.DataRow("单个克重")= dr1("单个克重")
End If
End If
[此贴子已经被作者于2008-12-29 14:49:43编辑过]