J
John
I have several listboxes on a form
How can i refer to them using an array
ie.
Dim sctlList(5) As Controls (I've tried as ListBox and as string)
sctlList(0) = Me.list1
sctlList(1) = Me.list2
sctlList(2) = Me.list3
sctlList(3) = Me.list4
sctlList(4) = Me.list5
Then when I need to refer to a specific list...
ctlList=sctlList(n) 'where n is a integer that I set as needed
ctlList.ItemSelected
etc....
What am I doing wrong?
How can i refer to them using an array
ie.
Dim sctlList(5) As Controls (I've tried as ListBox and as string)
sctlList(0) = Me.list1
sctlList(1) = Me.list2
sctlList(2) = Me.list3
sctlList(3) = Me.list4
sctlList(4) = Me.list5
Then when I need to refer to a specific list...
ctlList=sctlList(n) 'where n is a integer that I set as needed
ctlList.ItemSelected
etc....
What am I doing wrong?