i want to replace the alphabets with numbers from a text box and display in the result in another test box.Do not know how to achieve this.Please help.
Private Sub Form_Load()
txtID.Text = "a s d f"
txtSerial.Text = txtID.Text
End Sub
Private Sub cmdGet_Click()
Dim i as Integer
fsID = UCase(Replace(txtID.Text, " ", "")) ' Remove all spaces '
For i = 1 To Len(fsID)
ch = Mid(fsID, i, 1)
' Decoder '
Next
End Sub
Private Sub Decoder()
Select Case ch
Case "A"
txtSerial.Text = Replace(txtID.Text, "A", "0")
Case "B"
txtSerial.Text = Replace(txtID.Text, "B", "1")
Case "H"
txtSerial.Text = Replace(txtID.Text, "H", "2")
Case "E"
txtSerial.Text = Replace(txtID.Text, "E", "3")
Case "M"
txtSerial.Text = Replace(txtID.Text, "M", "4")
Case "N"
txtSerial.Text = Replace(txtID.Text, "N", "5")
Case "T"
txtSerial.Text = Replace(txtID.Text, "T", "6")
Case "I"
txtSerial.Text = Replace(txtID.Text, "I", "7")
Case "P"
txtSerial.Text = Replace(txtID.Text, "P", "8")
Case "R"
txtSerial.Text = Replace(txtID.Text, "R", "9")
End Select
End Sub