To expand figures to 5 digits, insert the following code in the "Exit" event of the Text Box:
L = Len(Me.TextBox1.Value)
If L < 5 Then
Me.TextBox1.Value = Application.Rept("0", 5 - L) & Me.TextBox1.Value
End If
To skip to the next Text Box after the 5th digit has been inserted, add the following code to the "Change" event:
If Len(Me.TextBox1.Value) = 5 Then Me.TextBox2.SetFocus
Both examples assume that the current textbox is named TextBox1 and the next textbox is named TextBox2.
Marc
Like this thread? Share it with others