Results 1 to 3 of 3
  1. #1
    Jimmace
    Guest

    Make mouse click on a text box select entire field

    [img]/w3timages/icons/clown.gif[/img] Going to a text box with a date input mask by tabbing selects the entire field so data entry starts with the left most character. If the user clicks in the box he will wind up in whatever position he clicks on.(month,day,year?) Is there a way to amke the mouse click either select the entire field or left position?
    Thanks, Jim

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Make mouse click on a text box select entire field

    Hi Jim,
    If you put Me!controlname.SelStart = 0 in the OnClick event of the control the cursor should jump to the start of the cell. Bear in mind that this might annoy users if they're trying to edit one character in that cell, though!
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Jimmace
    Guest

    Re: Make mouse click on a text box select entire field

    Thanks, rory! does exactly what I needed.

    Jim

Posting Permissions

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