Setting focus on text box

M

Mark

Hello all,

Access 97

I have a text box that I and using to post data for the users to see.

Something like this:

txResults = txResults & "Container: " & rs![CONT] & " Nest to: " &
rs![nest_to_cont] & vbCrLf

I'm looping through my code and populating this txResults field. Sometimes
there is more data then the window size. So, I set the properties to have
vertical scroll bars. This only works when the text has focus though. So
then I write code and have that field to set focus (txResults.setfocus).
However, when you do that it also selects all the text in the box once it has
focus.

My questions, is there a way to have the scroll bars automatically displayed
without setfocus? If not, is there a way to have it setfocus and not have it
select all the text?

Thanks
 
A

Allen Browne

After you SetFocus, you can set SelStart and SelLength.

If you never want the whole text selected, you could set the option under:
Tools | Options | Keyboard | Behavior Entering Field
 

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