Must be missing something here & driving me crazy.
Moving from Field 1 to field 2, I don't want the whole textbox highlighted
Private Sub Field1_Exit(Cancel As Integer)
Field2.SetFocus
End Sub
Private Sub Field2_GotFocus()
Field2.SelStart = 1
End Sub
If I simply tab from Field1 to Field2 it is fine, cursor moves to 2nd character and no highlighting.
If I jump to Field2 using setfocus from any other field it highlights the whole field.
Tried everything I can think of
Tried in on exit & every combination of different event triggering
Varying SelLength etc.
This is a test database & only these 2 fields.
I don't want to modify the core behaviour of the database.
This is the example I see everywhere & how to prevent highlighting & just does not work for me.
Private Sub Field1_Exit(Cancel As Integer)
With Me.Field2
.SetFocus
.SelStart = 1
.SelLength = 0 ' Nothing selected
End With
End Sub
Private Sub Field2_GotFocus()
' nothing
End Sub
If I mouse click on field2, it jumps to the 2nd character (SelStart 1) but of course nothing selected, I assume because of the mouse click
What am I missing?
Thanks I/A
Moving from Field 1 to field 2, I don't want the whole textbox highlighted
Private Sub Field1_Exit(Cancel As Integer)
Field2.SetFocus
End Sub
Private Sub Field2_GotFocus()
Field2.SelStart = 1
End Sub
If I simply tab from Field1 to Field2 it is fine, cursor moves to 2nd character and no highlighting.
If I jump to Field2 using setfocus from any other field it highlights the whole field.
Tried everything I can think of
Tried in on exit & every combination of different event triggering
Varying SelLength etc.
This is a test database & only these 2 fields.
I don't want to modify the core behaviour of the database.
This is the example I see everywhere & how to prevent highlighting & just does not work for me.
Private Sub Field1_Exit(Cancel As Integer)
With Me.Field2
.SetFocus
.SelStart = 1
.SelLength = 0 ' Nothing selected
End With
End Sub
Private Sub Field2_GotFocus()
' nothing
End Sub
If I mouse click on field2, it jumps to the 2nd character (SelStart 1) but of course nothing selected, I assume because of the mouse click
What am I missing?
Thanks I/A