The problem is your logic.
It appears that you want your code to execute if the first letter is neither S nor A. That is not what your logic says. However, this error should cause your code to always run, and you are saying it never runs.
Let's boil down you logic first.
If Strings.Left(Textbox1.Text, 1) <> "S" Or Strings.Left(Textbox1.Text, 1) <> "A" Then
If the first letter is S then your code will do this:
If "S" <> "S" Or "S" <> "A" Then
which evaluates to
If False Or True Then
which evaluates to
If True Then
Your If condition will always be True, no matter what the first letter is.
Second, I have never seen nor used String before. I just use Left. Try this and report back.
If this does not work then you have some other problem that is not related to the code you showed us here. Please attach your file and describe the steps you take for this code to run.
Bookmarks