+ Reply to Thread
Results 1 to 5 of 5

Textbox enable and set focus

  1. #1
    Forum Contributor ABSTRAKTUS's Avatar
    Join Date
    04-18-2010
    Location
    England
    MS-Off Ver
    Win10 Excel 2016
    Posts
    609

    Textbox enable and set focus

    Hi Gurus,

    It seems there are tonnes of solutions on how to set focus on certain objects, yet I struggle to find/adapt one to fit my needs.

    Assume you have 2 textboxes and command button on a userform, where txtbox1 will be enabled and txtbox2 disabled. Once user keys in anything in txtbox1, txtbox2 is being enabled using afterupdate event but focus is set on command button even it is out of tab index order.

    Question: how do I set focus on txtbox2 when I tab out of txtbox1..?

    A million thanks.

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Textbox enable and set focus

    Please Login or Register  to view this content.
    doesn't work?
    or
    Please Login or Register  to view this content.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Forum Contributor ABSTRAKTUS's Avatar
    Join Date
    04-18-2010
    Location
    England
    MS-Off Ver
    Win10 Excel 2016
    Posts
    609

    Re: Textbox enable and set focus

    Hi and sorry for a late reply. I have already tried this before and no luck. Basically within one sub I need to enable txtbox2 and set focus to it.

    This is a simple dummy code:

    Please Login or Register  to view this content.
    This will still set focus on a command button when tabbing out of txtbox1.

    The actual userform contains of course more than 2 textboxes as well as bunch of other objects, but that doesn't change anything. The actual code is similar to the one above. I don't know what else to try...

    Anybody? Please?

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Textbox enable and set focus

    Removed post because after spending more time with my own creation of this problem, I have no clue how to fix it......yet.
    Last edited by gmr4evr1; 02-01-2016 at 08:12 PM.

  5. #5
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Textbox enable and set focus

    I think I figured it out....add Me. before the Txtbox2(s)....like so...
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. textbox focus events
    By excelneub in forum Excel General
    Replies: 2
    Last Post: 05-26-2015, 07:34 PM
  2. textbox without focus
    By eugz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2014, 04:24 PM
  3. Focus on Textbox
    By seemanthv in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-09-2014, 02:38 AM
  4. [SOLVED] Textbox focus
    By tradinup2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-08-2013, 12:25 AM
  5. Textbox loses focus?
    By mike0123m in forum Excel General
    Replies: 1
    Last Post: 02-28-2012, 06:44 PM
  6. setting focus on a textbox
    By Geordie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2010, 12:26 PM
  7. How to tell what textbox got the focus
    By vqthomf in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2005, 09:15 AM

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