RANDOM ID BASED ON YOUR NAME

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
2 posts Page 1 of 1
Contributors
User avatar
Rookie
Top Poster
Top Poster
Posts: 85
Joined: Thu May 19, 2011 10:28 am

RANDOM ID BASED ON YOUR NAME
Rookie
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
  • the first one is the TxtID
  • and the second one is the txtname
just double click the second txtbox which is the txtname and paste the codes here.
Code: Select all
 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
THANKS TO YOU :)
User avatar
Rookie
Top Poster
Top Poster
Posts: 85
Joined: Thu May 19, 2011 10:28 am

Re: RANDOM ID BASED ON YOUR NAME
Rookie
i didn't copied this
i learned it through the tutorial of our school so i have decided to share it.
2 posts Page 1 of 1
Return to “Tutorials”