Foxtable(狐表)用户栏目专家坐堂 → INSERTNEW应用的问题


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

主题:INSERTNEW应用的问题

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


加好友 发短信
等级:婴狐 帖子:74 积分:683 威望:0 精华:0 注册:2011/10/24 19:38:00
INSERTNEW应用的问题  发帖心情 Post By:2012/3/15 17:32:00 [只看该作者]

Dim TEMP As String

Dim r As Row

TEMP=e.Form.Controls("Bh").Value.Substring(4,8)
max= Tables("bmk").Compute("Max(BH)","substring(bh,4,8) = " & temp & "" )

dr= Tables("bmk").Compute("Max(BH)","substring(bh,0,12) = " & temp & "" )
If max>"" Then
Tables("bmk").Position=Tables("bmk").findrow(dr) + 1
r=Tables("bmk").InsertNew()
Else
Tables("bmk"). Position=0
r=Tables("bmk").InsertNew()

End If

 

这段代码的意思就是自动编号,以当前编号为条件,查找比它小的编号中最靠近的编号,并且在这个记录后插入一行空白记录。

程序在运行中没有实现行的插入,请问问题出错在哪里?


 回到顶部
帅哥哟,离线,有人找我吗?
布莱克朱
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:623 积分:3897 威望:0 精华:0 注册:2011/8/3 22:13:00
  发帖心情 Post By:2012/3/15 21:34:00 [只看该作者]

Dim r As Row = Tables("表A").Current
Dim dr As DataRow
dr = DataTables("表A").Find("品牌 ='" & r("品牌") & "' And [编号]< " & r("编号"), "编号 Desc")
If dr IsNot Nothing Then
    Dim wz As Integer = Tables("表A").FindRow(dr)
    If wz >= 0 Then
        Tables("表A").Position = wz
        Tables("表A").InsertNew()
    End If
End If

 

  你跟着这个代码去修改吧!


 回到顶部