Link to home
Start Free TrialLog in
Avatar of J G
J G

asked on

zero pad a access form field

How do I zero pad a access form field?
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't particularly like to use input masks, but if you need to pad numeric values with leading zeros you will need to:

1.  Make sure it is a text field.
2.  Use the controls AfterUpdate event to add the padding, something like:

me.txtPadLeftWithZeros = Right("00000000" & me.txtPadLeftWithZeros, 8)

This way, the user doesn't need to initially add the leading zeros.