I have code to generate transaction number.
hire my code :
VB Code:
Function TransNumber() As String Dim oCmd As New OleDb.OleDbCommand Dim sNo As String = "P" Try oCmd.CommandText = "select top 1 pono from PURCHASE where order by pono desc" Dim dr As OleDb.OleDbDataReader dr = oCmd.ExecuteReader If dr.Read Then sNo = dr.Item("pono") + 1 Else sNo += "001" End If dr.Close() Catch ex As Exception End Try End Function
I had a problem when there are multiple users using the transaction or the serial number is, because the data overwrite each other.
how to make the correct serial number?




Reply With Quote