Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
I am using this code to try to highlight (select) the existing value in a textbox to allow a user to overtype a new value over the existing without having to manually select. Unfortunately it's not working. The value is not highlighted and the uer has to manually highlight it or delete it. Open to suggestions to improve.
Code:
Private Sub tb_s1_lwr_Enter()
If trnfrm_new = False Then
With Me.tb_s1_lwr
Oval = .Value
.BackColor = RGB(166, 166, 166) 'RGB(206, 234, 232)
.SelStart = 0
.SelLength = Len(Me.tb_s1_lwr)
End With
Exit Sub 'prevents field clearing
End If
tb_lower_enter Me, 1 '{frm_trn_services}*
End Sub