Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input Masks?

Status
Not open for further replies.

s0ccerdude

Technical User
Jul 2, 2003
38
US
I have a field in a form where I want users to enter a four digit number.

Examples:

0004 (instead of "4")
0027 (instead of "27")
0331 (instead of "331")...and so on.

I don't want users to be able to enter in the data incorrectly. I've tried using the input mask tool to no avail. Probably not doing it right. Any help would be appreciated.
 
If the user is to enter the leading zeros then you must define the field as text, of length 4 characters. You can use an input mask of 0000 to force the entry of 4 digits.
 
Thank you for responding. However, I'm not sure that I understand.

In the design view for the underlying table, I've tried limiting the text field to 4 characters and setting the input mask to "0000". When I try to enter in new numbers, the field defaults to "____" (i.e. 4 x "_") and I cannot enter any new numbers.

Can anyone please help find a solution? This has not yet been answered.
 
Set the input mask property of your text box to:

\0000

Hope this helps,
Collen
 
An input mask always shows underline characters where input is required. It is showing 4 _ because those are the positions of the input characters you must type.
If you tab into the field you will be positioned at the first character but if you click into the field you could be at any position depending on where you clicked.
 
Collen-

You're answer almost does the trick. However, when I limit the text field to 5 characters and set the input mask as recommended: "\0000", I can only enter in 3 digits for each record. For instance: 0124, 0023, 0007, etc.

This input mask makes the first digit a zero and then only allows me to enter up to 3 digits.

Any suggestions?
 
Lupins was right just use 0000 (without quotes or anything) in the input property of your text box.

Collen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top