Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Kendrick, Idaho, USA
    Posts
    277
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Automatically select field on click

    Access 97 - When the user tabs into a field, the field contents are selected, making it easy to overtype. When you use the mouse to enter the field, field contents are not selected (without dragging). Is it possible to get the mouse-click to select as the tab does?

  2. #2
    2 Star Lounger
    Join Date
    May 2001
    Location
    Omaha, NE USA, Nebraska, USA
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically select field on click

    From the main database window, go to Tools|Options... then select the Keyboard tab. An option group will appear at the top right. You can select the way you want Access to behave when entering each field. I have attached a screen shot of the dialog box.
    Attached Images Attached Images

  3. #3
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Minneapolis, Minnesota, USA
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically select field on click

    If you'd rather not make a global change, via code you can set the SelStart property of the control upon entering it. For instance, upon entering a field, set the SelStart = 0, and the cursor starts blinking at position 0.
    <font face="Comic Sans MS"><font color=blue>~Shane</font color=blue></font face=comic>

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Kendrick, Idaho, USA
    Posts
    277
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Automatically select field on click

    My problem is when using the MOUSE, I want the field to be selected upon clicking into it. Is that possible?

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

    Re: Automatically select field on click

    You could use the OnClick event of the textbox. Something like this:<pre>Private Sub txtYourField_Click()
    If Not IsNull(txtYourField.Value) Then
    txtYourField.SelStart = 0
    txtYourField.SelLength = Len(txtYourField.Value)
    End If
    End Sub</pre>

    This is a little tricky because you can't use the mouse to select part of the field to edit after this is implemented.

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

  6. #6
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Kendrick, Idaho, USA
    Posts
    277
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Automatically select field on click

    Thank you all. These should get the job done! I'm delighted to be introduced to the Sel group of commands that are new to me.

Posting Permissions

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