Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2003
    Location
    Manchester, NH
    Posts
    57

    Unanswered: How do I jump to a specific point in a field when entered

    I want to have the cursor jump to character number 5 of my tn field when you tab into that field. I already have created the record, and a default of 603-000-0000 already exists. I want to jump to that first 0 in the seven digit number. Thank you.

    Dalynching

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: How do I jump to a specific point in a field when entered

    Originally posted by dalynching
    I want to have the cursor jump to character number 5 of my tn field when you tab into that field. I already have created the record, and a default of 603-000-0000 already exists. I want to jump to that first 0 in the seven digit number. Thank you.

    Dalynching
    Use the GotFocus method of the textbox and then use the SelStart property to move the cursor to the desired position.

  3. #3
    Join Date
    Apr 2003
    Location
    Manchester, NH
    Posts
    57

    I can't get this to work!

    I tried the suggested method and I can't get it to work. Any help would be appreciated. Thank you.

    Dalynching

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Suppose taht your TextField is called Txt_Temp then use the following in the form Open

    txt_temp = "603-000-0000"
    txt_temp.SetFocus
    txt_temp.SelStart = 4
    txt_temp.SelLength = 1



    Tested ok

  5. #5
    Join Date
    Jun 2003
    Location
    Belgium
    Posts
    133
    Ever considered an input mask on your form?
    Might work as well without the coding and gives the advantage to "format" the user's input.

  6. #6
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Originally posted by Herman
    Ever considered an input mask on your form?
    Might work as well without the coding and gives the advantage to "format" the user's input.
    Note:
    With Input Mask, you could not jump to or mark a certain Charchter.

  7. #7
    Join Date
    Jun 2003
    Location
    Belgium
    Posts
    133
    quit right Hamm, but what I was suggesting is this :
    It's up to the developper to decide if he needs to jump to that place or if he wants the user to make his entry only starting from that place.
    In the example of Dalynching, it is very well possible that he wants the user's entry always to be starting with "603-" and additionally keep the format he is presenting.
    I was only suggesting this possibility to Dalynching....


    By the way, I must say your presented solutions are usually to the point. Thumbs up, Hamm!!

  8. #8
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    No matter, I understand your stuggestion.
    Your Answers are also useful and I get much info.

  9. #9
    Join Date
    Apr 2003
    Location
    Manchester, NH
    Posts
    57

    Thank you it works now!

    All ok!

    Dalynching

Posting Permissions

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