Foxtable(狐表)用户栏目专家坐堂 → 自动生成编号语局错误


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

主题:自动生成编号语局错误

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


加好友 发短信
等级:幼狐 帖子:124 积分:1071 威望:0 精华:0 注册:2014/3/4 22:06:00
自动生成编号语局错误  发帖心情 Post By:2014/4/22 22:52:00 [只看该作者]

Dim rq As WinForm.DateTimePicker = e.Form.Controls("日期")
Dim djlx As WinForm.ComboBox = e.Form.Controls("单据类型")
Dim pp As WinForm.ComboBox = e.Form.Controls("品牌")
Dim md As WinForm.ComboBox = e.Form.Controls("门店")
Dim djbh As WinForm.TextBox = e.Form.Controls("单据编号")

If rq.Value = Nothing   Then
    djbh.Text =""
 Else
        Dim bh As String = Format(rq.value,"yyyyMMdd") '取得编号的8位前缀
        If   DataTables("库调明细表_主表").DataRow("业务单号").StartsWith(bh) = False 
            Dim max As String
            Dim idx As Integer
            max = e.DataTables("库调明细表_主表").Compute("Max("业务单号")","单据日期 = #" & rq.Value & "# And [_Identify] <> " & DataTables("库调明细表_主表").DataRow("_Identify") And ) 
            If max > "" Then '如果存在最大编号
                idx = CInt(max.Substring(9,3)) + 1             Else
                idx = 1 
            End If
            djbh.text = bh & "-" & Format(idx,"000")
        End If
    End If
End If


 回到顶部