Foxtable(狐表)用户栏目专家坐堂 → [求助]


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

主题:[求助]

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


加好友 发短信
等级:婴狐 帖子:3 积分:91 威望:0 精华:0 注册:2013/5/29 17:50:00
[求助]  发帖心情 Post By:2013/6/1 16:58:00 [只看该作者]

示例:

      日期                    编号

 20120501              20120501001

 20120501              20120501002

 20120501              20120501003

 20120502              20120502001

 20120502              20120502002

 20120502              20120502003

.

.

.

 

我是按帮助做的入库单的自动生成编号:

If e.DataCol.Name = "入库日期" Then
    If e.DataRow.IsNull("入库日期") Then
        e.DataRow("入库单号") = Nothing
    Else
        Dim bh As String = Format(e.DataRow("入库日期"),"yyyyMMdd") '取得编号的8位前缀
        If e.DataRow("入库单号").StartsWith(bh) = False '如果编号的前8位不符
            Dim max As String
            Dim idx As Integer
            max = e.DataTable.Compute("Max(入库单号)","入库日期 = #" & e.DataRow("入库日期") & "# And [_Identify] <> " & e.DataRow("_Identify")) '取得该天的最大编号
            If max > "" Then '如果存在最大编号
                idx = CInt(max.Substring(9,3)) + 1 '获得最大编号的后三位顺序号,并加1
            Else
                idx = 1 '否则顺序号等于1
            End If
            e.DataRow("入库单号") = bh & "-" & Format(idx,"000")
        End If
    End If
End If

结果总是:

 

.NET Framework 版本:2.0.50727.3643

Foxtable 版本:2013.5.26.1

错误所在事件:表,入库主表,DataColChanged

详细错误信息:

Exception has been thrown by the target of an invocation.

Public member 'StartsWith' on type 'Integer' not found.

我百思不解,请高手指教。

 


 回到顶部