Dim NewID As String
Dim FirstID As String
Dim LastID As Long
With cmd
.Parameters.Clear()
.Connection = conn
.Transaction = tr
.CommandText = sqlSave
dr = .ExecuteReader()
If dr.HasRows Then
With dr
.Read()
NewID = .GetString(.GetOrdinal("cus_id"))
End With
FirstID = StringExt.StringFromRight(NewID, 5)
LastID = CLng(StringExt.StringFromRight(NewID, 5))
LastID += 1
FirstID = "C" & LastID.ToString("00000")
Else
NewID = "C" & "00001"
End If