Results 1 to 8 of 8
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Control Collection (Word 97SR2)

    The sequential numbering of userform control objects is not the same as the tab order numbering.

    For i = 1 To Me.Controls.Count
    Set aControl = Me.Controls(i)
    Debug.Print aControl.Name & " : " & aControl.TabIndex
    Debug.Print aControl.Name & " : " & i
    next

    The collection item order is created as the controls are created. The question is: can the controls in the collection be renumbered?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Control Collection (Word 97SR2)

    Kevin, I don't think the item(index) an be changed, though obviously the item("name") can be. Would changing the Tab index suffice ?

    Andrew

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Control Collection (Word 97SR2)

    Andrew,

    I'm trying to associate a label control with a txt, drp(combo), lst or opt control. For now, I'm using the tag property to name the label and the "data" controls so the code knows one is associated with the other.

    I'm writing a procedure that resizes an form and places the visible controls in order.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Control Collection (Word 97SR2)

    ...but to answer your question, yes the tabindex would work if I could enumerate the controls by tabindex.

    Hummm.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Control Collection (Word 97SR2)

    Since labels don't have a tabindex, what would you do about them?
    Charlotte

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Control Collection (Word 97SR2)

    Charlotte,

    I think Label controls do have a Tab index.

    It may not have any obvious use but does exist.

    Andrew

  7. #7
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Control Collection (Word 97SR2)

    Andrew,

    Yes, labels do have a tabindex (at least in Word/Excel VBA and VB)- and there is a use.

    If a label has an accelerator key, and it is activated by Alt + (key), control is given to the control with the next highest tabindex which can take focus.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Control Collection (Word 97SR2)

    Sorry, Andrew. I was thinking of Access, where they don't.
    Charlotte

Posting Permissions

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