Results 1 to 2 of 2

Thread: Passing an array of CommandButtons

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Ont, Canada, Earth
    Posts
    458
    Hi,
    How can I pass a control array of command buttons to a function and use it?
    I have 4 arrays of command buttons and want to pass each to a function that will change some of their properties.

    CommandArrayOne(11)
    CommandArrayTwo(11)
    CommandArrayThree(11)
    CommandArrayFour(11)

    Basically I have something like this but it doesn't work:

    '------------------------------------------------
    Private Sub MySub(ACommandArray() As CommandButton)
    For ctr = 1 to 10
    ACommandArray(ctr).visible = False
    Next ctr
    End Sub
    '------------------------------------------------

    'I wanted to use it like:
    MySub CommandArrayOne

    Thanks
    Thanks

    Tomexx.

  2. #2
    Guest
    Code:
    Private Sub MySub(cmdCommandButton As Object)
        For I = cmdCommandButton.lbound To cmdCommandButton.ubound
            cmdCommandButton(I).Visible = False
        Next I
    End Sub
    Usage:
    Code:
    MySub CommandArrayOne

Posting Permissions

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



Click Here to Expand Forum to Full Width