Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Warrington, Cheshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cursor Position in field with Input Mask (2003)

    I have a Text field on a form set up with an Input Mask. If the user tabs into the field, the cursor is positioned at the left hand end of the input area and typing correctly starts at the first character.
    If they use a mouse click to put the cursor into the field, the cursor is positioned where the mouse click occurred and so, typing starts at a random position within the required character string.
    Is there a way to force the position of the cursor to always be at the first character position, regardless of how the field was entered, please?
    Thanks
    Silverback
    Silverback

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cursor Position in field with Input Mask (2003)

    Put the following code in the On Mouse Up event of the text box :
    Me.Text0.SelStart = 0
    Replace Text0 with the name of your textbox.

    Be aware that you'll never be able to move the cursor with the mouse.
    Francois

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Warrington, Cheshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cursor Position in field with Input Mask (2003)

    Many thanks, Francois. Works perfectly.
    Silverback
    Silverback

Posting Permissions

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