Solved

Control Names

Posted on 2001-06-21
2
160 Views
Last Modified: 2010-05-02
How do I get the name of a control (any control) at run time using code ?
0
Comment
Question by:Vogon
2 Comments
 
LVL 50

Accepted Solution

by:
Ryan Chong earned 50 total points
ID: 6213846
For Each c In Controls
        List1.AddItem c.Name
    Next
0
 
LVL 6

Expert Comment

by:simonbennett
ID: 6213897
...to be more specific

Public Sub Command1_OnClick()

   Dim cntControl as Control

   For Each cntControl In Me.Controls
      msgbox cntControl.Name
   Next cntControl

End Sub

If this suits, please accept ryancys answer over mine.

HTH

Simon
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

808 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