VB自动编码的代码

发布网友 发布时间:2024-10-24 02:53

我来回答

3个回答

热心网友 时间:2024-11-06 22:40

你的编号的编码方式是以日期 + 'd' + 数字串为基础的,但是你的所有数字串都是1,当然,每天运行的结果都一样了!!!!!!1
Data1.RecordSource = "select * from djb order by 凭证号码"
Data1.Refresh
If Not Data1.Recordset.EOF Then Data1.Recordset.MoveLast
If lsph.Text = "" Then bh.Text = Date & "d" & Format(1, "###000") '这句
If lsph.Text <> "" Then
y1.Text = Month(Date)
'y2.Text = Month(Left(lsph.Text, 10))
If y1.Text = y2.Text Then
'这句
bh.Text = Date & "d" & Format(Val(Right(lsph.Text, 3)) + 1, "###000")
End If
If y1.Text <> y2.Text Then
'这句
bh.Text = Date & "d" & Format(1, "###000")
End If
End If

热心网友 时间:2024-11-06 22:41

用for循环改,方便

热心网友 时间:2024-11-06 22:43

哪里是生成编号的啊?

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com