Private Sub autonumber()
:bigsmile:
Dim maxid As Integer
'sql statements
strsql = "select @@identity from tblepinfo "
With acscmd
.CommandText = strsql
.Connection = acsconn
End With
acsda.SelectCommand = acscmd
maxid = acscmd.ExecuteScalar
Dim newID As Int32 = maxid + 1
Dim ynow As Integer = Year(Now())
Dim newid As String = ynow & newID
MsgBox(newPurchaseOrderID)
acsda.Dispose()
acscmd.Dispose()
End Sub
the output is 20121
what i want is 2012-0001
please can anybody can help me with the format? i really need it

New Topic/Question
Reply




MultiQuote




|