Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,570
- Office Version
- 365
- 2016
- Platform
- Windows
I have this code which accepts a telephone number entry in a userform textbox (xtended_ci.p_tn1) from the user.
The code opens up the field for editing, highlights the field by applying a backcolor, and provides a mask of the data to be entered. I would like this default text to be overwritten by the user's entry without the user having to manually highlight the text. What I have doesn't appear to be the solution.
Open to improvements to make this work.
VBA Code:
With p_tn1
.Enabled = True
.Locked = False
.BackColor = clr_blue
.Text = "###.###.####"
.SetFocus
.SelStart = 0
.SelLength = 12
End With
The code opens up the field for editing, highlights the field by applying a backcolor, and provides a mask of the data to be entered. I would like this default text to be overwritten by the user's entry without the user having to manually highlight the text. What I have doesn't appear to be the solution.
Open to improvements to make this work.