For Each dr1 As DataRow In DataTables("库存临时表").Select("商品代码 Is Not Null") Dim dr2 As DataRow = DataTables("库存明细表").Find("商品代码 = '" & dr1("商品代码") & "'And 颜色分类 = '" & dr1("颜色分类")&"'") If dr2 Is Nothing Then dr2 = DataTables("库存明细表").AddNew() dr2("商品代码") = dr1("商品代码") dr2("品牌名称") = dr1("品牌名称") dr2("颜色分类") = dr1("颜色分类") dr2("库存数量") = dr1("入库数量") dr2("合计金额") = dr1("合计金额") End If dr2("库存数量") = dr2("库存数量") + dr1("入库数量") dr2("合计金额") = dr2("合计金额")+dr1("合计金额") Next
|