Foxtable(狐表)用户栏目专家坐堂 → 怎么把这两个代码合并到一起


  共有1593人关注过本帖平板打印复制链接

主题:怎么把这两个代码合并到一起

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


加好友 发短信
等级:五尾狐 帖子:1062 积分:9781 威望:0 精华:0 注册:2012/3/13 5:23:00
怎么把这两个代码合并到一起  发帖心情 Post By:2017/1/17 20:43:00 [只看该作者]

我的思路是

name行发生变化后

1 判断 输入的name是有内容在  proudct
   有 。。。。
   没有 提示添加商品
2 判断 输入的name是否在 (weixindanhao.wexin)表 有相同的name
   if 有  就不添加新的行(或者添加后 删除)
      然后在原先的 行的shuliang 加1
   if 没有  就添加新的行

脑子不好用,请各位大神指点



If e.DataCol.Name="name"
      Dim dr As DataRow = DataTables("product").Find("[shangpinming] = '" & e.NewValue & "'")
        If dr IsNot Nothing Then
                e.DataRow("cord") = dr("cord")
                e.DataRow("markprice") = dr("markprice")
                e.DataRow("price") = dr("sellprice")
                e.DataRow("kg") = dr("kg")
                        e.DataRow("name") = dr("shangpinming")
      Else
             If dr Is Nothing Then
                     messagebox.show("没有此商品 请在入库单先入库")
       forms("商品").open ' e.Cancel=True
      End If
      End If
 End If
If e.DataCol.name="name" Then
Dim r As Row = Tables("weixindanhao.weixin").Current
Dim idx As Integer = Tables("weixindanhao.weixin").FindRow("name = '" & r("name") & "' and [_Identify] <> " & r("_Identify"))
If idx >= 0 Then
    msgbox("已存在")
    Tables("weixindanhao.weixin").Rows(idx)("shuliang") += 1
    r.delete
End If
End If

 回到顶部
总数 13 1 2 下一页