Hi
Please help I want to be able to enter a line of text into a text box in the format
Surname Firstname SUBJECT1......SUBJECT5 DOB
I need to enter it in this format with 5 subjects containing 3 characters each.
Now each line will always have a surname and firstname but the number of subjects can vary. The DOB may or may not be at the end of the line.
It then needs to be rearranged in the format
Firstname Surname DOB SUBJECT1.....SUBJECT5
I have done this so far but it wont work!!! Please help
Please help me.
I need to know whats wrong. Please Please Please.
Please help I want to be able to enter a line of text into a text box in the format
Surname Firstname SUBJECT1......SUBJECT5 DOB
I need to enter it in this format with 5 subjects containing 3 characters each.
Now each line will always have a surname and firstname but the number of subjects can vary. The DOB may or may not be at the end of the line.
It then needs to be rearranged in the format
Firstname Surname DOB SUBJECT1.....SUBJECT5
I have done this so far but it wont work!!! Please help
Visual Basic:
words = Split(TextBox1.Text, " ")
If Microsoft.VisualBasic.Right(TextBox1.Text, 2) = number And Len(words(2)) = 3 And Len(words(3)) = 3 And Len(words(4)) = 3 And Len(words(5)) = 3 And Len(words(6)) = 3 Then
TextBox2.Text = words(1) + " " + words(0) + " " + words(7) + " " + words(2) + " " + words(3) + " " + words(4) + " " + words(5) + " " + words(6)
ElseIf Microsoft.VisualBasic.Right(TextBox1.Text, 2) = number And Len(words(2)) = 3 And Len(words(3)) = 3 And Len(words(4)) = 3 And Len(words(5)) = 3 Then
TextBox2.Text = words(1) + " " + words(0) + " " + words(6) + " " + words(2) + " " + words(3) + " " + words(4) + " " + words(5)
ElseIf Microsoft.VisualBasic.Right(TextBox1.Text, 2) = number And Len(words(2)) = 3 And Len(words(3)) = 3 And Len(words(4)) = 3 Then
TextBox2.Text = words(1) + " " + words(0) + " " + words(5) + " " + words(2) + " " + words(3) + " " + words(4)
ElseIf Microsoft.VisualBasic.Right(TextBox1.Text, 2) = number And Len(words(2)) = 3 And Len(words(3)) = 3 Then
TextBox2.Text = words(1) + " " + words(0) + " " + words(4) + " " + words(2) + " " + words(3)
ElseIf Microsoft.VisualBasic.Right(TextBox1.Text, 2) = number And Len(words(2)) = 3 Then
TextBox2.Text = words(1) + " " + words(0) + " " + words(3) + " " + words(2)
ElseIf Len(words(2)) = 3 And Len(words(3)) = 3 And Len(words(4)) = 3 And Len(words(5)) = 3 And Len(words(6)) = 3 Then
TextBox2.Text = words(1) + " " + words(0) + " " + words(6) + " " + words(2) + " " + words(3) + " " + words(4) + " " + words(5)
ElseIf Len(words(2)) = 3 And Len(words(3)) = 3 And Len(words(4)) = 3 And Len(words(5)) = 3 Then
TextBox2.Text = words(1) + " " + words(0) + " " + words(5) + " " + words(2) + " " + words(3) + " " + words(4)
ElseIf Len(words(2)) = 3 And Len(words(3)) = 3 And Len(words(4)) = 3 Then
TextBox2.Text = words(1) + " " + words(0) + " " + words(4) + " " + words(2) + " " + words(3)
ElseIf Len(words(2)) = 3 And Len(words(3)) = 3 Then
TextBox2.Text = words(1) + " " + words(0) + " " + words(3) + " " + words(2)
ElseIf Len(words(2)) = 3 Then
TextBox2.Text = words(1) + " " + words(0) + " " + words(2)
End If
Please help me.
I need to know whats wrong. Please Please Please.