+ Reply to Thread
Results 1 to 6 of 6

auto advance of textboxes

  1. #1
    Forum Contributor
    Join Date
    07-08-2015
    Location
    Indiana
    MS-Off Ver
    Excel 2007
    Posts
    128

    auto advance of textboxes

    Hey there. I must be missing something with this code.
    On a userform, I am attempting to be in a textbox called txtPTagLtr. When 1 character is input (can be anything) it will automatically advance to the next text box called intPTagNo.

    Here is Select Code copy to clipboard
    Private Sub txtPTagLtr_Change()


    'whenever there is 1 character registered in the TextBox

    If txtPTagLtr.TextLength > 0 Then NOTE: I tried = 1 and it still didnt work

    'select (SetFocus) the next TextBox

    intPTagNo.SetFocus

    End If


    End Sub[/CODE]
    I have even gone so far as to go into the textbox properties of txtPTagLtr and change max length to 1; auto tab to True. If I look at the tab index positions, the textbox txtPTagLtr is 2, and the intPTagNo is 3.


    Any ideas why it wont automatically advance when a character is input?

  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: auto advance of textboxes

    I tried it both ways, and it worked. Is the name of the txtPTageLTr text box correct?
    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
    Join Date
    07-08-2015
    Location
    Indiana
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: auto advance of textboxes

    Yes. I actually copy/pasted it into the code, and the same with this post.
    Would it have anything to do with it going from a txt textbox to an int textbox?

    Would it possibly help to cut those 2 text boxes out and try again?

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: auto advance of textboxes

    Scott

    There's only one type of textbox and the only input they take are text.

    Can you upload a sample workbook with a userform that demonstrates the problem?
    If posting code please use code tags, see here.

  5. #5
    Forum Contributor
    Join Date
    07-08-2015
    Location
    Indiana
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: auto advance of textboxes

    I am not sure what happened. I cut them both out, and remade them. And now it works. Doesn't make sense/.
    Thanks for your assistance

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

    Re: auto advance of textboxes

    Glad you were able to figure it out.

+ 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. Automatic advance between textboxes on a userform
    By scott micklo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-22-2016, 06:21 PM
  2. auto advance cell references
    By pmartens07 in forum Excel General
    Replies: 6
    Last Post: 11-28-2015, 10:07 AM
  3. auto advance entries
    By clundeen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-03-2011, 01:29 PM
  4. Auto Row Advance
    By z3tls0 in forum Excel General
    Replies: 1
    Last Post: 02-22-2011, 10:06 PM
  5. Auto advance with date/time stamp
    By ADWaters in forum Excel General
    Replies: 2
    Last Post: 09-02-2010, 01:27 PM
  6. How to auto-advance an array formula
    By AussieExcelUser in forum Excel General
    Replies: 7
    Last Post: 11-28-2006, 01:34 AM
  7. Auto advance to next field -tab key AND option button to reset fie
    By ~KO in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-01-2006, 05:40 PM

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