Hi,
I'm fairly new to VBA.
I want to check that a user is entering the correct code into the form Textbox as they press a command button which decodes the product ticket code.
The code string is always 10 or sometimes 11 characters long.
Last 1 or 2 characters of the string are always digits and the 5 character of the string is always a W (IE: 4NXOWDHBC14)
My decode VBA command button works fine.
I now want to add in error handling for the following scenarios:
- The user enters nothing in the textbox and presses the button
- The users enters less than 10 characters
- The user enters more than 11 characters.
What's the best way of attacking this in a VBA process/programming way?
I imagine with what I have already learnt in VBA, the Len function, IF and elseIf function and Msgbox's
I can't seem to get the right combination in the right order, can anyone help or point me in the right direction please.
Thanks