RANDOM ID BASED ON YOUR NAME
Posted: Sat Nov 26, 2011 9:45 am
hi everyone here's some code that can help you also whenever you create a system or something like that! hehe
first add two textbox

first add two textbox
- the first one is the TxtID
- and the second one is the txtname
Code: Select all
THANKS TO YOU Try
If txtname.Text.Length >= 3 Then
Dim num As String
num = Format(CInt(Rnd() * 1000), "000")
Dim letters As String = ""
letters = txtTitle.Text.Substring(0, 3)
Dim month As String
month = Format(Today, "MMM").ToUpper
Dim year As Integer
year = Today.Year
txtID.Text = num & letters & "-" & month & year
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
