Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Control array

Status
Not open for further replies.

jpspring

Programmer
Oct 6, 2000
25
GB
if i've got a control of say 5 checkboxes and i want to pass all five controls to a sub-procedure to check them all, how would i do this?

test check1()

sub test(chkbox() as checkbox)
end sub

doesn't work, it expects an user-type
 
you could try doing this

Dim chk As CheckBox
For Each chk In Me.Controls
Call checkchk(chk)
Next
End Sub


Private Sub checkchk(chk As CheckBox)
MsgBox chk.Value
End Sub

Depending on the value you want to check or change or whatever change the code in the checkchk procedure
 
what i'm actually trying to do is pass a the whole control array to the sub-routine in one go. Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top