#2
cwa99582023-11-09 08:26
|
哪位大师可以帮忙看下下面代码如何更改成按每天日期进行新的编号,如当日是:2023-10-12-RZ0001,第二日则是:2023-10-13-RZ0001,2023-10-13-RZ0002
Private Sub zdbh() '自动编号+1
'自动编号~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Call OpenConn
SQL = "select 编号 from 施工日志表 ORDER BY 编号"
rs.Open SQL, cn, 1, 1
If rs.RecordCount > 0 Then
rs.MoveLast
Text1(0).Text = Date & "-RZ" & Format(Val(Right(rs.Fields("编号"), 4) + 1), "0000")
Else
Text1(0).Text = Date & "-RZ0001"
End If
Call CloseConn
End Sub