Foxtable(狐表)用户栏目专家坐堂 → [求助]这个代码哪里错了,不为空时


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

主题:[求助]这个代码哪里错了,不为空时

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


加好友 发短信
等级:童狐 帖子:238 积分:1838 威望:0 精华:0 注册:2014/7/1 8:56:00
[求助]这个代码哪里错了,不为空时  发帖心情 Post By:2016/1/17 0:13:00 [只看该作者]

If e.DataCol.Name =  "clxx_lphm" Then
    If e.DataRow("clxx_lphm") > "" Then
        e.DataRow("ajdjh") = Nothing
    Else
        Dim y As Integer = Date.Today.Year
        Dim qz As String = Tables("jgbmwh").Rows(0)("bmqz")
        Dim bh_temp As String = qz & "字[[]" & y & "[]]"
        Dim bh As String = qz & "字[" & y & "]"
        Dim  max As String
        Dim  idx As  Integer
        max = e.DataTable.Compute("Max(ajdjh)","ajdjh like '" & bh_temp & "%' And [_Identify] <> " & e.DataRow("_Identify"))
        If  max > "" Then '如果存在最大编号
            idx = CInt(max.Substring(bh.Length, 5)) + 1  '获得最大编号的后三位顺序号,并加1
        Else
            idx = 1 '否则顺序号等于1
        End  If
        e.DataRow("ajdjh") = bh & Format(idx,"00000") & "号"
    End  If
End If

 

我在clxx_lphm单元格不为空时自动编号

这个代码错在哪里,请大侠指教,谢谢

 


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/1/17 10:56:00 [只看该作者]

If e.DataRow("clxx_lphm") > "" Then

 

改成

 

If e.DataRow.IsNull("clxx_lphm") Then


 回到顶部