大概这样写,楼主自己修改一下。
Dim s As Row = Tables("入库").Current
Dim dt1,dt2,dt3 As DataTable dt1 = DataTables("入库") dt2 = DataTables("实时") dt3 = DataTables("入库汇总")
Dim dr As DataRow = dt2.find("货号 = '" & s("货号") & "'") If dr IsNot Nothing Then dr("数量") = dr("数量") - dt1.Compute("sum(数量)","货号 = '" & s("货号") & "'") End If
dr = dt3.find("货号 = '" & s("货号") & "'") If dr IsNot Nothing Then dr("数量") = dr("数量") - dt1.Compute("sum(数量)","货号 = '" & s("货号") & "'") End If
s.Delete MessageBox.Show("商品删除成功!")
|