Results 1 to 5 of 5

Thread: Select Text

  1. #1
    JamesP
    Guest

    Select Text

    Hi
    I would like have all the text in a textbox be selected when a user clicked in it.
    Is there a way to do this.

    Thank you!

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    La Verne, California, USA
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select Text

    Yes! Go to TOOLS/OPTIONS/KEYBOARD/BEHAVIOR ENTERING FIELD/SELECT ENTIRE FIELD.

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select Text

    Hi James,
    There is probably a better way to do this but here's a start:<pre>Private Sub YourField_Click()
    If IsNull(YourField.Value) Then 'handles a null value
    Exit Sub
    Else
    YourField.SelStart = 0
    YourField.SelLength = Len(YourField.Value)
    End If
    End Sub</pre>

    HTH <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select Text

    The option to Select Entire field only works when Entering the field, either by Tab key or by setting focus with macro or code. If a user clicks the text field it will de-select the enter field and place the cursor where the user clicked.
    Sorry <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15> - I didn't make the rules... <img src=/S/innocent.gif border=0 alt=innocent width=20 height=20>

  5. #5
    JamesP
    Guest

    Re: Select Text

    Thanks Guys

    I have couple of options now!
    Who did make the rules any ways! <img src=/S/bummer.gif border=0 alt=bummer width=15 height=15> :]

Posting Permissions

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