i got a homework its about Generate code
Name: qwerty
Year Enrolled: 2008
IDNum: 123mem
Button: GENERATE CODE
Code: 083memrty
{ 2 last degit from year became the 2 first, 4 last from IDNum became 4 next, 3 last from name became 3 next= 083memrty}
1. validate the text boxes for presence
2. validate year for format (should be numeric and 4 chars)
3. i already explain how to get the code.
any help plz
my firt code:
Private Sub cmdGenerateCode_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdGenerateCode.Click
Dim YE As String = txtYearEnrolled.Text
If (txtName.Text = "") Then
MsgBox("Name text box is empty")
ElseIf (txtYearEnrolled.Text = "") Then
MsgBox("Year Enrolled Text box is empty")
ElseIf YE < YE.Chars(4) Then
MsgBox("Year Enrolled text box comtain more than 4 number")
ElseIf Not IsNumeric(txtYearEnrolled.Text) Then
MsgBox("Year Enrolled is not a numeric")
End If
i got problem here:
ElseIf YE < YE.Chars(4) Then