txtTest.Text="lock255 "
If txtTest.Text.SubString(txtTest.Text.Length-1)=" " Then
Msgbox(txtTest.Text & "You have a space at the end","") '1st time you get this
Else
Msgbox("no space","")
End If
txtTest.Text=txtTest.Text.Trim
If txtTest.Text.SubString(txtTest.Text.Length-1)=" " Then
Msgbox("You have a space at the end","")
Else
Msgbox(txtTest.Text & "no space","") '2nd time you get this
End If