+ Reply to Thread
Results 1 to 11 of 11

TextBox.SetFocus not working

  1. #1
    Registered User
    Join Date
    05-10-2007
    Posts
    12

    TextBox.SetFocus not working

    if i write the following function on a checkbox,
    Please Login or Register  to view this content.
    it works like expected. the text box is selected, selection is visible and caret can be moved with directional keys.

    however, if i try to do the same on an _Enter event on a second text box, it wont work.
    Please Login or Register  to view this content.
    the caret stays in the tbTargetFullText textbox.

    any ideas??

  2. #2
    Forum Contributor WinteE's Avatar
    Join Date
    04-07-2007
    Location
    Netherlands
    Posts
    544
    Remove the Me. in front of tbSourceFullText.
    Just keep it simple !


    http://www.excelguide.eu
    In English as well as in Dutch

  3. #3
    Registered User
    Join Date
    05-10-2007
    Posts
    12
    Quote Originally Posted by WinteE
    Remove the Me. in front of tbSourceFullText.
    no diff, still wont work

  4. #4
    Forum Contributor WinteE's Avatar
    Join Date
    04-07-2007
    Location
    Netherlands
    Posts
    544
    Run the code step by step to find out where the code fails.

  5. #5
    Registered User
    Join Date
    05-10-2007
    Posts
    12
    Quote Originally Posted by WinteE
    Run the code step by step to find out where the code fails.
    i do not get any indications that code fails, nor does the VBA report that anything bad happend.

  6. #6
    Forum Contributor WinteE's Avatar
    Join Date
    04-07-2007
    Location
    Netherlands
    Posts
    544
    Is cbTagAutoInsert True or not ?

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    05-10-2007
    Posts
    12
    Quote Originally Posted by WinteE
    Is cbTagAutoInsert True or not ?

    Please Login or Register  to view this content.
    first of all, i'd like to thank you for your time, but i would really feel much better if you didn't treat me like an idiot. i do know what code execution is, i do know what breakpoints do and i do know how the if statements work. i also know that this freakin SetFocus GETS executed, it just doesn't do what it should.

  8. #8
    Forum Contributor WinteE's Avatar
    Join Date
    04-07-2007
    Location
    Netherlands
    Posts
    544
    Lets start saying that I don't think anyone else being an idiot !

    Sometimes people are looking that long to their code they don't see the simple errors anymore.

    Erik

  9. #9
    Registered User
    Join Date
    05-10-2007
    Posts
    12
    Quote Originally Posted by WinteE
    Lets start saying that I don't think anyone else being an idiot !

    Sometimes people are looking that long to their code they don't see the simple errors anymore.

    Erik
    agreed!
    sry i freaked out, but this freakin script is just drivin me mad...

    is there any other way to transfer focus/control onto another control??

  10. #10
    Forum Contributor WinteE's Avatar
    Join Date
    04-07-2007
    Location
    Netherlands
    Posts
    544
    At work I had something the same in a program I have made several years ago. I'll look at it next Monday. Keep hope !

    Have a nice weekend.

    Erik

  11. #11
    Forum Contributor WinteE's Avatar
    Join Date
    04-07-2007
    Location
    Netherlands
    Posts
    544
    I knew it had something to do with .SetFocus, but it was to get .Dropdown working properly.
    My knowledge ends here.

    Erik

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1