Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Selstart (MS Access 2003)

    I have a textbox that has an input mask 00:00:00:00. I have two problems. The first is when I set focus to I want the cursor to be in the first left handside. Instead its all highlighted. I tried a selstart value , Me.MTCEnd.SetFocus, Me.MTCEnd.SelStart = 1 but it still enters in a highlighted mode. Problem number two, after text is entered how do I get its content in a formatted mode the same as the input mask? Many thanks

  2. #2
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Selstart (MS Access 2003)

    Just found Selstart should be 0 not 1. So thats out of the way, but any help on the formating of the text into 00:00:00:00 appreciated.

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

    Re: Selstart (MS Access 2003)

    1) Try setting the SelLength property to 0 in the On Enter event of the text box:
    <code>
    Private Sub MTCEnd_Enter()
    Me.MTCEnd.SelLength = 0
    End Sub
    </code>
    2) Set the input mask to
    <code>
    00:00:00:00;0;_
    </code>
    The 0 in the second section specifies that the : characters are included in the value of the text box.

  4. #4
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Selstart (MS Access 2003)

    Many thanks Hans. Setting my Selstart=0 seems to work okay, however thanks for the input mask setting - works a treat.. Good to get that sorted so I can move again. Very best regards

Posting Permissions

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