opposite of set focus?

  • Thread starter Thread starter Richard Stricker
  • Start date Start date
R

Richard Stricker

When I navigate thru my records on a form one of the text boxes always has
the text "selected". If I drop the cursor in the text it "unselects" and is
more readable. How do I keep any text box text from being selected when i am
reviewing my records?

Thanks for any help.

Richard
 
One way is to tab to something that's not a textbox (e.g. a button) before
you start reviewing your records.
 
Here's something I use occasionally:

1. put an unbound text box on the form called txtFocusTrap
2. delete the label that's attached to the text box.
3. set both its Height and Width to 0" so you can't see it on the form so
you can't see it (setting it's Visible Property won't work here)
4. in the Form's Open event, insert
Me!txtFocusTrap!SetFocus

You can of course use that SetFocus method in other events as well.

HTH

Paul
 
Many thanks for the ideas to deselect the text. Each solution had its
strengths.

In the current project using the selLength method seemed appropriate.

In the Form.Current this code:
itemTxt.SetFocus
itemTxt.SelLength = 0

Kept the text from being selected and made the form more readable.

Thanks again for sharing your knowledge.

Richard
 
Back
Top