Foxtable(狐表)用户栏目专家坐堂 → [求助]单价如何判断货号录入?


  共有9127人关注过本帖树形打印复制链接

主题:[求助]单价如何判断货号录入?

帅哥哟,离线,有人找我吗?
lin_hailun
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:6708 积分:34304 威望:0 精华:11 注册:2012/8/18 23:10:00
  发帖心情 Post By:2012/11/13 17:42:00 [显示全部帖子]

 代码如下

Dim s As Row=Tables("入库单").Current
If Tables("入库单").Current.IsNull("货号") Then
    MessageBox.Show("货号不能为空!")
Else
    Dim dt1,dt2 As DataTable
    dt1 = DataTables("入库单")
    dt2 = DataTables("实时库存表")

    For Each dr As DataRow In dt1.DataRows
        Dim dr2 As DataRow = dt2.find("货号 = '"& dr("货号") &"'")
        If dr2 Is Nothing Then
            dr2 = dt2.AddNew
            dr2("货号") = dr("货号")
            dr2("入库数量") = 1
            dr2("单价") = dr("单价")
        Else
            dr2("入库数量") = dr2("入库数量") + 1
        End If
    Next
    MessageBox.Show("商品入库成功!")
    Forms("入库单").Close
End If

 回到顶部