Help with SelStart. In textbox want cusor to be at end of txt on c

G

Guest

I use a text box where status notes are entered.
Problem is after notes and entered and saved and I go back to review or add
data to them, the text is in highlighted text until I hit click when the
cusror goes to the end of the text.
How to I get rid of the highlight and have the cusor be at the end of
exisiting text?
 
R

ruralguy via AccessMonster.com

Put the following in the OnEnter event as code:

Private Sub txtBoxName_Enter()

Me.txtBoxName.SelStart = Me.txtBoxName.SelLength

End Sub

...using your txtBoxName of course!
 
G

Guest

I still need to Click to ge rid of hiighlighted text when I enter the Notes
sub form txt box of the record.
Also, I get an error message when I entered the event code as suggested.
The 1st line of the code is highlighted in yellow.
the name of the txtbox is Notes Text.
Help !
 
R

ruralguy via AccessMonster.com

Post *exactly* what code you have in the event starting with Private Sub and
ending with End Sub.
 
G

Guest

-- Private Sub Notes_Text_Enter()

Me.Notes_Text.SelStart = Me.Notes_Text.SelStart

End Sub

Joan
 
R

ruralguy via AccessMonster.com

Try
Me.[Notes Text].SelStart = Me.[Notes Text].SelLength

One of the problems with embeded spaces in names. It is best *not* to use
them. Much better to use CamelFontNames.
-- Private Sub Notes_Text_Enter()

Me.Notes_Text.SelStart = Me.Notes_Text.SelStart

End Sub

Joan
Post *exactly* what code you have in the event starting with Private Sub and
ending with End Sub.
[quoted text clipped - 11 lines]
 
G

Guest

I did as instructed the 1st time not on a draft copy of the form I am
updating, but with what I call the working form: It worked.
I put the code both in click and enter.
Thanks for your help.
--
Joan


ruralguy via AccessMonster.com said:
Try
Me.[Notes Text].SelStart = Me.[Notes Text].SelLength

One of the problems with embeded spaces in names. It is best *not* to use
them. Much better to use CamelFontNames.
-- Private Sub Notes_Text_Enter()

Me.Notes_Text.SelStart = Me.Notes_Text.SelStart

End Sub

Joan
Post *exactly* what code you have in the event starting with Private Sub and
ending with End Sub.
[quoted text clipped - 11 lines]
How to I get rid of the highlight and have the cusor be at the end of
exisiting text?

--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
 
R

ruralguy via AccessMonster.com

Joan,
It *only* needs to be in the Enter event. I would recommend removing the
code from the Click event. Glad to hear you got it working.
I did as instructed the 1st time not on a draft copy of the form I am
updating, but with what I call the working form: It worked.
I put the code both in click and enter.
Thanks for your help.
Try
Me.[Notes Text].SelStart = Me.[Notes Text].SelLength
[quoted text clipped - 15 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top