On Enter Event Procedure
On Enter Event Procedure
(OP)
I've been using the following code in the On Enter Event Procedure to make the cursor go to the end of the text in a text box instead of highlighting it:
Me!txtActionItem.SelStart = Me!txtActionItem.SelLength
Is there another way to have this code apply to the entire form, as opposed to putting it in for each text box?
Me!txtActionItem.SelStart = Me!txtActionItem.SelLength
Is there another way to have this code apply to the entire form, as opposed to putting it in for each text box?
Linda Adams
Garridon@aol.com
Linda Adams Online
I'm a professional writer, published internationally.
RE: On Enter Event Procedure
One of the options is to create a private function in your form:
==========
Private Sub GoToEnd(strField As String)
Me(strField).SelStart = Me(strField).SelLength
End Sub
==========
Then on the Got Focus Event of each field you want this to happen to, put the following:
==========
Private Sub City_GotFocus()
Call GoToEnd("City")
End Sub
==========
Replace the red to the same as the bolded field name:
This will be alot of code, as every text box On Got Focus Event will have Call GoToEnd("FieldName"), but it will work.
Jim Lunde
compugeeks@hotmail.com
CompuGEEKS
Custom Application Development
RE: On Enter Event Procedure
Can't you just go to the Tools/Options/Keyboard Tab and select "Go to End of Field" under "Behavior Entering Field"? This makes the cursor go to the end of the fields instead of highlighting the complete field.