OK How would I do it....
I would move it to SQL
I would create an actual account numbering scheme
Along those lines I had a thought.
Why don't you use a drop down with the account name? You can enter a letter or number to jump to that part of the list. That may be easier?
Another Idea would be to use a list box or drop down.
Have a field for the user to enter
Then have a list box control.
Set it up to show all values which start with what the user entered. Since you have the space problem it might be easier to use the starts with instead of equal. I am not sure how many permutations you have such as AB1 and AB1B2 but I am guessing it should not be too many.
I thought you had it working for some values. Another option is add another field to your form (adjustedNumber) which you set with the concatenation to pad the spaces and then you is in your comparison. [RelmID = adjustedNumber]