Full Version: Vba To Check For Alpha Characters
UtterAccess Forums > Microsoft® Access > Access Forms
I have a text box on a form that accepts a railcar number, eg. GACX 6027. The issue I'm having is that the text needs to be exact. If someone accidently enters the railcar as GACX6027 (without the space) I need the OnExit event to fire to correct this to GACX 6027. Basically I just need to make sure there is a space between the Alpha characters and the numeric characters. I'm not sure what the best way to tackle this is. Any advice would be greatly appreciated. Thanks in advance.
If the value is always the same length and format (ABCD 1234), you can create a custom input mask and use it...
Unfortunately, this is not the case. The Alpha characters can be anywhere for 3 to 5 letters and the numeric characters can be anywhere from 2 to 6.
To make sure they just enter a space, you could just put:
Like "?* #*"
in the VAlidation Rule of the field in the table. Though they could still mess up the input by mixing letters/numbers, this would prompt them to separate the alpha and numeric with a space.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.