Placing cursor

simongallop

Registered User.
Local time
Today, 20:49
Joined
Oct 17, 2000
Messages
611
Sure this is simple but brain hibernating for the winter.

How do I get VB Code to place my cursor at the end of a string in a textbox? Textbox is the focus.

Thanks in advance

Simon
 
Not the nicest way I'm sure, but it works...
________________________________________
Private Sub Form_Open(Cancel As Integer)

Me.textBoxName.SetFocus
SendKeys "{F2}"
SendKeys "{END}"

End Sub
________________________________________

Hope this helps
 
Thanks. It works. Don't need the END as f2 starts at the end.

[This message has been edited by simongallop (edited 10-18-2000).]
 
Put this code in the On Enter event of the text box where you want the cursor at the end of the string:

Me![FieldName].SelStart = Me![FieldName].SelLength
 

Users who are viewing this thread

Back
Top Bottom