Cursor (?) property in text box

ChristopherM

Registered User.
Local time
Today, 22:56
Joined
Jan 5, 2000
Messages
38
In Access 97 Tools/Options/Keyboard/Behaviour Entering Field I have selected "Select entire field". However, for some text boxes I would like to change this so the cursor is positioned at the end of the text. I assume there must be some code that can be triggered at the Enter or Got Focus event but I am can't seem to find it.

Thanks for your help
 
Hi Chris

Try this,

Private Sub yourtext_GotFocus()

Dim textlen

textlen = Len(yourText.Text)
yourText.SelStart = textlen
End Sub

It counts the length of the text, stores it and then sets the cursor starting point to the stored value.

I tried it in VB, hope it works in VBA too.

Rich
 
Just checked selStart, seltext and SelLength are in VBA, search in help if you want to know more about these functions.

Rich
 

Users who are viewing this thread

Back
Top Bottom