Results 1 to 5 of 5

Thread: Force tab

  1. #1
    Star Lounger
    Join Date
    Mar 2008
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a user form with several text boxes that need to be filled in. How can I force each textbox to tab to the next after it has been updated?

    Thanks for any assistance you can provide!!!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    When the user presses Enter or Tab after entering data in a text box, focus will shift to the next control in the tab order, so it's a matter of setting the tab order correctly.

    Open the userform in the Visual Basic Editor.
    Select View | Tab Order...
    You can select a control in the list and click Up or Down to change the tab order.
    Click OK when you're done.

  3. #3
    Star Lounger
    Join Date
    Mar 2008
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='b0bito' post='776440' date='22-May-2009 10:29']I have a user form with several text boxes that need to be filled in. How can I force each textbox to tab to the next after it has been updated?

    Thanks for any assistance you can provide!!![/quote]


    Hans thanks for the information. I've already got the form set up in this way for if a user manually types the value into the text box. The text boxes that I'm currently using have 3 ways to fill them in. First is the obvious to manully type the value (in this case it's a date) into the text box. The second is to double click the text box to display a seperate user form that is actually a date selection form. This date selection form functions much like and active X control but does not cause some users the issue that I've come across with active X controls. The 3rd is to click on a calendar icon to the right of the text box that will again display the date selection form. After the date is selected from the date selection form. The final part is the date selection form will update the text box with the date that was selected. When using the date selection form to update the text box. I'd like to auto tab to the next text box. I'm not sure if this is possible. I've played around with most of the different tab options and can't seem to find anything that will work in this scenario. I think I'm going to have to give up trying and just require the user to use tab to go to the next text box. Any thoughts??

    Thanks!

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You can use the SetFocus method of a text box control to activate it, e.g.

    Code:
    Private Sub cmdCalendar_Click()
      ' Code to open date selection form here
      ...
      ' Activate next text box
      Me.txtNextDate.SetFocus
    End Sub
    Without knowing the exact setup of your form it's hard to give more specific help.

  5. #5
    Star Lounger
    Join Date
    Mar 2008
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='777823' date='01-Jun-2009 12:15']You can use the SetFocus method of a text box control to activate it, e.g.

    Code:
    Private Sub cmdCalendar_Click()
      ' Code to open date selection form here
      ...
      ' Activate next text box
      Me.txtNextDate.SetFocus
    End Sub
    Without knowing the exact setup of your form it's hard to give more specific help.[/quote]


    Hans,

    Thanks again.

    SetFocus was again one of the options I did not yet try. (UserForm1.TextBox2.SetFocus) I simply needed to specify my form name, the text box name and then set focus and this got me what I needed.

Posting Permissions

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