实现年+月+4位数值(数增使用)当数据库领用单号字段为空时显示为20064130001,当数据库已存在则递增,但是当手动修改系统时间为2006513时最后4位数还是在原有基础上递增不能实现20065130001而显示为200650002
Dim lsph As Integer '定义一个整型变量
TxtSQL3 = "select * from 领用登记 order by 领用单号"
adoCon.Execute TxtSQL3
If Not Rs3.EOF Then Rs3.MoveLast
If trim(Rs3.Fields("领用单号")) <> "" Then
lsph = Right(Trim(Rs3.Fields("领用单号")), 4) + 1
Label3.Caption = Year(Date$) & Month(Date$) & Day(Date$) & Format(lsph, "0000")
End If
Else
Label3.Caption = Year(Date$) & Month(Date$) & Day(Date$) & "0001"
End If