+ Reply to Thread
Results 1 to 6 of 6

tab order in forms

Hybrid View

  1. #1
    Registered User
    Join Date
    07-03-2006
    Posts
    74

    tab order in forms

    Hi guys & gals,

    why doesn't vba respect the tab order entered in, euh, "Tab order"? I mean, I made a userform with a dozen or so inputs, I want it to cycle through them in a particular order, so entered that order in "Tab order", I check the "Taborder"-attributes of each input, and they are correct (0 to 11), but when I launch the d@mn thing, the cursor sits in input #6, looking stupid. There, I said it!..
    Seriously now, anybody have a clue as to why, when everything seems ok, it still doesn't work?
    "Colors fade, but dumb is forever" - Sally Solomon

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    How have you set the Tab Order?
    You need to right click on the UserForm in the VB Editor & choose Tab Order.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    07-03-2006
    Posts
    74
    Weeeelll, I don't know, what do you think I did? Let's see:

    Quote Originally Posted by opopanax666
    so entered that order in "Tab order", I check the "Taborder"-attributes of each input, and they are correct
    Sorry for the sarcasm, "but the field was wide open"...

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    only you know what you've done. If you have set the Tab order correctly then you shouldn't have a problem. if you want to be rude, maybe you think clever, then you can help yourself!

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello opopanax666,

    VBA respects the tab order, but it is control creation order that dictates which control will receive the focus once the UserForm is displayed. If you input control is a TextBox you can direct which one will have the cursor by using the code below. Just change the TextBox name to match the one you want to be first.
    Private Sub UserForm_Activate()
      TtextBox1.SetFocus
    EndSub
    Now the tabbing will start from this control. If its tab order is 0 (zero) then the next control will be the one whose tab order is 1.

    Sincerely,
    Leith Ross

  6. #6
    Registered User
    Join Date
    07-03-2006
    Posts
    74
    Quote Originally Posted by Leith Ross
    Hello opopanax666,

    VBA respects the tab order, but it is control creation order that dictates which control will receive the focus once the UserForm is displayed. If you input control is a TextBox you can direct which one will have the cursor by using the code below. Just change the TextBox name to match the one you want to be first.
    Private Sub UserForm_Activate()
      TtextBox1.SetFocus
    EndSub
    Now the tabbing will start from this control. If its tab order is 0 (zero) then the next control will be the one whose tab order is 1.

    Sincerely,
    Leith Ross
    Marvellous, works like a charm...

    Cheers, matey!

+ 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