Cannot put my finger on this tab behaviour.... can anyone ad
MZ Tools makes life easier for the Excel VBA coder
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Cannot put my finger on this tab behaviour.... can anyone ad

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Posts
    162
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    hi,

    I`m working on a user form. It consists of a few textboxes. The data inputted here is being organised in an excel sheet. The partial code looks like this:

    Private Sub TBL1_Change()
    Worksheets("sheet1").Range("B2").Value = TBL1
    If Not IsNumeric(TBL1.Value) Then
    MsgBox "Alleen numerieke data is toegestaan", vbExclamation, "Invalid Entry"
    If Len(TBL1.Text) >= 5 Then TBL2.SetFocus
    End If
    End Sub

    Private Sub TBL1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    L = Len(Me.TBL1.Value)
    If L < 5 Then
    Me.TBL1.Value = Application.Rept("0", 5 - L) & Me.TBL1.Value
    TBL2.SetFocus
    End If
    End Sub

    This is just the code for 1 textbox. As you can see after filling 5 digits the focus skips to the next textbox, this work fine.

    What you can also see that if someone fills in 312 and then tabs, 00312 is registred. And then my problem occurs: when tabbing out when less then 5 digits are filled in
    (using the fill to 5 digits function)the focus is not skipped to textbox 2 but to text box 3!!


    How can this be?

    Other facts:

    Autotab is on
    Tabindex is correct.


    I hope someone can give some tips. `Cos I can`t seem to figure it out!


    [ This Message was edited by: Dinictus on 2002-03-21 02:14 ]

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi

    I ran your code and it worked just fine!
    Double check your properties???

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Posts
    162
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Really?

    Of course, you say so...
    I`ll check my properties again then..

    Thanks man.

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com