求代码!!!利用日期和自动编号创建新的流水号
创建自动编号6的时间是2007-7-13 15:23
需要创建个流水号
200707130006
帮忙发下
------解决方案--------------------Dim t,M,D
If Len(Month(date)) <2 Then
M= "0 "&Month(date)
Else
M=Month(date)
End If
If Len(Day(date)) <2 Then
D= "0 "&Day(date)
Else
D=Day(date)
End If
t=Year(date)&M&D
.....
Counts=rs.recordcount+1
If Len(Counts)=1 Then
Counts= "0000 "&Counts
End If
If Len(Counts)=2 Then
Counts= "000 "&Counts
End If
If Len(Counts)=3 Then
Counts= "00 "&Counts
End If
If Len(Counts)=4 Then
Counts= "0 "&Counts
End If
ID=Year(date)&Month(date)&Day(date)&Counts
上面是我的项目中用到的。希望能帮你