Dim lbl8 As WinForm.Label
lbl8 = e.Form.Controls("label8")
Dim bh As String = Format((Date.now),"J'F'DyyyyMMdd-") '取得出库编号的12位前缀
lbl8.text = bh
Dim idx As Integer
Dim dr2 As DataRow
If DataTables("CLSXJCJFD").DataRows.Count >= 1 Then
dr2 = DataTables("CLSXJCJFD").DataRows(DataTables("CLSXJCJFD").DataRows.Count -1)
If BH = DR2("DJBH").Substring(0,12) Then
BH = DR2("DJBH")
IDX = CINT(BH.SubString(BH.LENGTH -3,3)) + 1
Else
idx = 1
End If
Else
idx = 1 '否则顺序号等于1
End If
lbl8.text = BH.SubString(0,12) & Format(idx,"000")
此主题相关图片如下:qq截图20171112125531.png
[此贴子已经被作者于2017/11/12 13:05:24编辑过]