Set the a differet value of a textbox based on input value

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hello to everybody.
In a textbox I shoult type the value from 1 to 9 in the following way: 01,
02, 03, 04, 05, etc
However may times I type only one digit: 1, 2, 4, 5, etc.
Is there a way to get always as result 01, 02, 03.
This way will help me a lot during the report sorted out by column

Thanks for your help and regards
John
 
Hello to everybody.
In a textbox I shoult type the value from 1 to 9 in the following way: 01,
02, 03, 04, 05, etc
However may times I type only one digit: 1, 2, 4, 5, etc.
Is there a way to get always as result 01, 02, 03.
This way will help me a lot during the report sorted out by column

Thanks for your help and regards
John

Make the field a Text datatype field.
 
As Fred wrote, make the field a Text datatype field, then:

Private Sub YourFieldName_Exit(Cancel As Integer)
If Len(Me.YourFieldName) < 2 Then
Me.YourFieldName = "0" & Me.YourFieldName
End If
End Sub
 
Back
Top