Select Case e.DataCol.name
Case "商品编号", "批号", "货位号"
Dim dr As DataRow = DataTables("库存").Find("商品编号='" & e.DataRow("商品编号") & "' and 批号='" & e.DataRow("批号") & "' and 货位号='" & e.DataRow("货位号") & "'")
If dr Is Nothing Then
dr = DataTables("库存").AddNew()
dr("商品编号") = e.DataRow("商品编号")
dr("通用名") = e.DataRow("通用名")
dr("批号") = e.DataRow("批号")
dr("规格") = e.DataRow("规格")
dr("入库数量") = e.DataRow("入库数量")
dr("入库类型") = e.DataRow("入库类型")
dr("货位号") = e.DataRow("货位号")
dr("单价") = e.DataRow("单价")
Else
dr(”入库数量") = dr(“入库数量") + e.DataRow("入库数量")
End If
End Select
http://www.foxtable.com/webhelp/scr/1472.htm