This takes the user input into text1 converts it into a numeric code and encrypts the text in another form, but if you try and make it use hello i get an overflow error, hel works ok. Help, please;

Private Sub CmdOK_Click()
If Text1.Text = "" Then Exit Sub
AlphaKey = Text1.Text
finalkey = ""
thelastchar = Len(AlphaKey)
For i = 1 To thelastchar
theletter = Mid(AlphaKey, i, 1)
finalkey = finalkey & Asc(theletter)
Next i
Open "pass.log" For Output As #1
thelastchar = Len(FrmPasswords.Text1.Text)
For i = 1 To thelastchar
theletter = Mid(FrmPasswords.Text1.Text, i, 1)
Print #1, Asc(theletter) Xor finalkey; <<<<<<- Here
Next i
Close #1
SaveSetting "passpro", "Encryption", "codeno", finalkey
SaveSetting "Passpro", "Encryption", "Cryptvalue", "2"
Open "pass.log" For Input As #1
FrmPasswords.Text1.Text = Input(LOF(1), 1)
Close #1
Unload frmKey
End Sub

thanks:-)