looping through controls

The following code does not sem to work

 Dim iObj As Control
 
 For Each iObj In Me.Controls
  If iObj.Tag = "hidden" Then
        iObj.Visible = False
  End If
 Next


in each controls tag I place the word "hidden". The controls will consist of labels, textboxes and pictureboxes.
LVL 1
dwe0608Asked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>The following code does not sem to work

did you debug through it?
what does it do?

Dim iObj As Control
 
 For Each iObj In Me.Controls
  debug.print iObj.Name
  If iObj.Tag = "hidden" Then
        iObj.Visible = False
  End If
 Next

does this list the Controls?



0
 
dwe0608Author Commented:
AngelIII, yes, but its a long list ... I have the controls in an array (for each type of control).

pft ... I had misspelled "hidden" - only had one "d" and well what a time waster this has been ....

answer this query for the points ....

If I wanted to store the names of each control in an ini file - including its index, how would I do that ? I could then retrieve it later and then make the controls either hidden or visible depending on the value contained in the ini file ?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.