Foxtable(狐表)用户栏目专家坐堂 → 自动编号 问题2,


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

主题:自动编号 问题2,

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


加好友 发短信
等级:四尾狐 帖子:842 积分:5971 威望:0 精华:0 注册:2013/6/29 9:36:00
自动编号 问题2,  发帖心情 Post By:2016/3/22 13:37:00 [只看该作者]

接上篇问题:http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=82273&page=1&star=1
代码是写在:窗口:复制增加按钮上的。


图片点击可在新窗口打开查看此主题相关图片如下:qq截图20160322132835.jpg
图片点击可在新窗口打开查看
If Tables("材料").TopPosition > -1 Then '如果选定区域包括数据行
    Dim dr As Row = Tables("材料").Current
    Dim s As String = dr("定额编码")
    If s > "" AndAlso s.Length <= 6 Or s.Contains("-")=False AndAlso s.Length > 6 Then
        Dim r As Row = Tables("材料").InsertNew()
        r("材料名称") =dr("材料名称")
        r("定额编码") =dr("定额编码") & "-1"
        r("规格") =dr("规格")
        r("分类") =dr("分类")
        r("子分类") =dr("子分类")
        r("单位") =dr("单位")
        r("类别代码") =dr("类别代码")
        r("图片") =dr("图片")
        r("网址") =dr("网址")
        r("网址2") =dr("网址2")
        r("网址3") =dr("网址3")
        r("材料文件") =dr("材料文件")
        r("成本价") =0
        Forms("材料维护").show
      ElseIf  s > "" AndAlso s.Contains("-") AndAlso s.Length > 6 Then
        Dim s1() As String = s.Split("-")
        Dim Index As Integer = s.LastIndexOf("-")
        Dim bh As String = s.SubString(0,Index+1)
              Dim max As String
                Dim idx As Integer
max = e.DataTable.Compute("Max(定额编码)","定额编码 (这个列的前面部分与bh相同,怎么写?)= '" & bh & "' And [_Identify] <> " & e.DataRow("_Identify")) '取得该类别的最大编号
      ????

    End If
End If
[此贴子已经被作者于2016/3/22 13:38:51编辑过]

 回到顶部