Actually this section for VB 4/5/6, and your code is for VB.Net Section.
For your question.
I suggest to trap any character except "abcdefg" and "12345" when user type it on textbox. So user only can input "abcdefg" or "12345".
Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444