Hi To all,
I have a field in a table. The field size s three. If the user enters a one character for example, how can I build an input mask to allow leading zeros?
Example:
1 ---> 001
k ---> 00k
23 --> 023
123 --> 123
Khalil
Hi To all,
I have a field in a table. The field size s three. If the user enters a one character for example, how can I build an input mask to allow leading zeros?
Example:
1 ---> 001
k ---> 00k
23 --> 023
123 --> 123
Khalil
I'm not sure that can be done with an input mask. I think you would need some code the the Before Update event of a control on a form.
If this helped, please click the star at the bottom left of this posting and add to my reputation. Many thanks.
Bob Fitzpatrick
On refection, the code would need to be in the AfterUpdate event of the control. Something like:
Code:Select Case Len(Me.ActiveControl) Case 1 Me.ActiveControl = "00" & Me.ActiveControl Case 2 Me.ActiveControl = "0" & Me.ActiveControl End Select
If this helped, please click the star at the bottom left of this posting and add to my reputation. Many thanks.
Bob Fitzpatrick
Hi,
Thank you.
Or instead of CASE:
Me.controlname = IIf(IsNull(Me.controlname), Null, Right("00" & Me.controlname, 3))
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.