How do I Dim an Array of Controls?

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.
 
G

Guest

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
 
B

Bruce Rusk

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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top