Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    875
    Thanks
    0
    Thanked 2 Times in 1 Post

    Move Ccursor to End of Text in Text Box (Access 97)

    I have typed a few characters into a text box and then done something that has moved the focus to another control and then back to the text box. When the focus comes back all the text in the text box is highlighted. What can I add to the VBA code to make the cursor end up at the end of the text I entered earlier?

    Thanks,
    Bill

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Move Ccursor to End of Text in Text Box (Access 97)

    The end of the text can be found using the SelLength property of the textbox. Then you can set the SetStart property to SelLength + 1.
    Charlotte

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Move Ccursor to End of Text in Text Box (Access 97)

    I think you meant SelStart instead of SetStart. And it's sufficient to set it to SelLength. SelStart can range from 0 to SelLength.

  4. #4
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    875
    Thanks
    0
    Thanked 2 Times in 1 Post

    Re: Move Ccursor to End of Text in Text Box (Access 97)

    Thanks Charlotte for that reminder. I knew that kind of capability was available but I couldn't think of the key words. It works great!

    Bill

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Move Ccursor to End of Text in Text Box (Access 97)

    You're absolutely right, Hans. I had a case of fat fingers and a fat head! <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •