Input Mask

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to create an input mask that will fill in leading zeros when I enter
data directly into a table. The field is text field of length 4. When I enter
"99" I want it to store "0099" in the table. When I enter "1" I want it to
store "0001" and so on. Thanks in advance.
 
Hi, Landeye,

I'm not sure that is possible with an input mask, but would be easy to do
with an AfterUpdate event:

Dim intI as Integer
For intI = (len([YourField]) + 1) to 4
[YourField] = "0" & [YourField]
Next intI

Hope that helps.
Sprinks
 
landeye said:
I want to create an input mask that will fill in leading zeros when I enter
data directly into a table. The field is text field of length 4. When I enter
"99" I want it to store "0099" in the table. When I enter "1" I want it to
store "0001" and so on. Thanks in advance.

Right("0000" & [YourNumber], 4)

should do it.

Tom Lake
 
Back
Top