
Passing Control Array to a SUB/FUNCTION
Yes. But instead of using the CommandButton object type, use the generic
Object data type.
Private Sub AlignCommandButtons(oCommandButtons As Object)
Dim oCommandButton As CommandButton
For Each oCommandButton In oCommandButtons
oCommandButton.Left = 300
Next
End Sub
Private Sub Form_Click()
AlignCommandButtons Command1()
End Sub
Mike
Quote:
> Is it possible to pass a control array to a subroutine such as:
> Call AlignCommandButton(cmdMyButtons())
> Sub AlignCommandButton(cmdLocal() as commandbutton)
> Do stuff
> END SUB