Input Mask -- Leading Zeros

eepok

Noob. Well, mostly noob.
Local time
Yesterday, 22:33
Joined
Oct 30, 2007
Messages
112
Wow! Long time, no see! I played a lot with Access 2003 about 4 years ago, but stopped and work no longer required it. I'm now presented with a very, very simple database (1 table with a form view) that I want to make better (remove the option for human error).

Issue: I don't understand the variables/radicals in making an input mask. I want a mask to have a definite 3 letters ("UIC") followed by 7 digits. That sounds easy enough, but I want the user to just have to enter just the last X digits as necessary.

Example: User types "4450". Result should be UIC0004450.
Example: User types "7". Result should be UIC0000007.

First Attempt: "UIC"0000000;0; but I knew that wouldn't work because it requires the user to enter all 7 digits.

Lastly, I believe my signature is no longer very accurate. While I'm a very appreciative user, I'm pretty sure I've forgotten a lot of Access in my years of being spoiled by Filemaker.
 
Your requirement is not possible with the Input mask. You would have to include the leading zeros manually. You could use VBA to add them but there is a much better way.

Store just the number as a Long Integer.

Set the Format property of the controls where it is displayed (and the table field if you wish) to add the rest of it.

"UIC"0000000
 
That works perfectly! Thanks!
 

Users who are viewing this thread

Back
Top Bottom