looping through controls

Posted on 2006-04-10
Last Modified: 2010-08-05
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

in each controls tag I place the word "hidden". The controls will consist of labels, textboxes and pictureboxes.
Question by:dwe0608
    LVL 142

    Accepted Solution

    >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

    does this list the Controls?

    LVL 1

    Author Comment

    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 ?
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Introduction This article makes the case for using two modules in your VBA/VB6 applications to provide both case-sensitive and case-insensitive text comparison operations.  Recently, I solved an EE question using the LIKE function.  In order for th…
    Article by: Martin
    Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now