Hi,
I have the following code to add dash mark to TextBox1 value depending on some condtions (mentioned in the code), the code works perfectly, but when we use Backspace Key to clear some charactors it is conflicting with the code running when changing Textbox1 value.
Private Sub TextBox1_Change()
With TextBox1
If .Value = "OMTND" Then .Value = .Value & "-"
If OptionButton1 = True And Len(.Value) = 8 And IsNumeric(Right(.Value, 2)) Then .Value = .Value & "-"
If OptionButton1 = True And Len(.Value) = 11 And IsNumeric(Right(.Value, 2)) Then .Value = .Value & "-"
End With
End Sub
I there any solution for that?
Thanks,
Bookmarks