Foxtable(狐表)用户栏目专家坐堂 → 请教一下如何写窗口表中自动编号的按钮代码?


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

主题:请教一下如何写窗口表中自动编号的按钮代码?

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110553 积分:562655 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/7/17 9:31:00 [显示全部帖子]

Dim txt1 As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim t As Table = e.Form.controls("table1").Table
Dim r As Row = t.Rows(0)
Dim k As Integer = val(txt1.Text)
r("第二列") = Format(k,"0000")
For i As Integer = 1 To t.Rows.Count - 1
    Dim r2 As Row = t.Rows(i)
    If r("第一列") = r2("第一列") Then
        r2("第二列") = r("第二列")
    Else
        k += 1
        r2("第二列") = Format(k,"0000")
    End If
    r = r2
Next

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110553 积分:562655 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/7/17 17:56:00 [显示全部帖子]

Dim txt1 As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim t As Table = e.Form.controls("table1").Table
Dim r As Row = t.Rows(0)
Dim m As String = r("第一列")
Dim k As Integer = val(txt1.Text)
r("第一列") = Format(k,"0000")
For i As Integer = 1 To t.Rows.Count - 1
    Dim r2 As Row = t.Rows(i)
    If m = r2("第一列") Then
        r2("第一列") = r("第一列")
    Else
        k += 1
        m = r2("第一列")
        r2("第一列") = Format(k,"0000")
    End If
    r = r2
Next

 回到顶部