Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Amersfoort, Utrecht, Netherlands
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    setfocus without selection (97 NL)

    Hello all,

    If I set the focus on a form to an other field, Access will select the contents of that field.
    Is it possible to automaticaly deselect the contents and just put the cursor at the end of the text?

    Thanks in advance for your answer.

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

    Re: setfocus without selection (97 NL)

    If you would like this as a general setting, select "Go to end of field" in the "Behavior entering field" section of the Keyboard tab of Tools | Options... This is a user-level setting.

    For an individual case, use code like this:
    <pre>With Me.ControlName
    .SetFocus
    .SelLength = 0
    .SelStart = Len(.Text)
    End With
    </pre>

    where ControlName is the name of the control you want to set focus to (it must be a text box or combo box.)

Posting Permissions

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