How do I Dim an Array of Controls?

  • Thread starter Thread starter Sandy S.
  • Start date Start date
S

Sandy S.

Hello!

I have a form that contains many text box controls. When
a user clicks on a command button I would like the code
to look at just a select few of these controls and clear
the values. Do you know how I may do this without having
to re-create all of these controls as a group or an
array? I would like to keep them independant but hate
specifying each control when writing code (it gets
awfully cumbersome).

Any help you can provide is MUCH appreciated.

Thank you,

Sandy S.
 
Sandy

I use the tag property of the controls to "assign" them to diffeent groups, then you simply do a loop, check the tag value and do your thing accordingly

Vlad
 
Use a collection rather than an array, then use a for each loop to cycle
through them. You just need to set up the collection when the form is opened
(and make declare the collection at the module level).
 
Back
Top