Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Re: De-Highlight Unbound Text Box

Geek News

Re: De-Highlight Unbound Text Box
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_gmail.com> 12/3/2008 8:43:38 PM
Oops, that should have been

With Me!MyTextbox
.SetFocus
.SelStart = .SelLength
End With


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_gmail.com> wrote in message
news:...
[Quoted Text]
> With Me!MyTextbox
> .SetFocus
> .SelText = .SelLength
> End With
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
> "dbarmer" <dbarmer[ at ]discussions.microsoft.com> wrote in message
> news:DD29FA36-5F9B-4043-9E6E-13CE916C09CE[ at ]microsoft.com...
>>I have an unbound text box that I use on a form that updates text to it as
>> code progresses in VBA. It updates the user what the program is doing.
>> It
>> works well, however, I can't seem to get the "highlight" off the text.
>> Is
>> there a way to get that insertion point at the end of the text - in the
>> unbound text box, or at least not highlight at all...
>
>


Re: De-Highlight Unbound Text Box
Marshall Barton <marshbarton[ at ]wowway.com> 12/3/2008 10:09:18 PM
Douglas J. Steele wrote:

[Quoted Text]
>Oops, that should have been
>
> With Me!MyTextbox
> .SetFocus
> .SelStart = .SelLength
> End With


How about
.SelStart = Len(.Text)

--
Marsh
MVP [MS Access]
Re: De-Highlight Unbound Text Box
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_gmail.com> 12/3/2008 10:24:04 PM
"Marshall Barton" <marshbarton[ at ]wowway.com> wrote in message
news:ap0ej45h3hil5lejjacf9f964i0kik784f[ at ]4ax.com...
[Quoted Text]
> Douglas J. Steele wrote:
>
>>Oops, that should have been
>>
>> With Me!MyTextbox
>> .SetFocus
>> .SelStart = .SelLength
>> End With
>
>
> How about
> .SelStart = Len(.Text)

I don't see any difference between the two. You still need to set focus on
the control, and I don't see any advantage of Len(.Text) over .SelLength.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)



Re: De-Highlight Unbound Text Box
Marshall Barton <marshbarton[ at ]wowway.com> 12/3/2008 11:47:11 PM
Douglas J. Steele wrote:

[Quoted Text]
>"Marshall Barton" wrote
>> Douglas J. Steele wrote:
>>
>>>Oops, that should have been
>>>
>>> With Me!MyTextbox
>>> .SetFocus
>>> .SelStart = .SelLength
>>> End With
>>
>>
>> How about
>> .SelStart = Len(.Text)
>
>I don't see any difference between the two. You still need to set focus on
>the control, and I don't see any advantage of Len(.Text) over .SelLength.


SelLength depends on the setting in Behavior entering field,
the state of the F2 and other keys and on what else has
happened since the text box received the focus. If the text
box is modified in a code loop, it might retain the focus
for a long time and a lot might have happened.

--
Marsh
MVP [MS Access]

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net