Solved

Control Names

Posted on 2001-06-21
2
157 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 49

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
to transfer string from C lanaguage to VBA 4 56
message box in access 4 41
Recommendation vb6 to vb.net or others 14 104
VB 6 error 5 in windows 10 but not in XP 7 39
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

929 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

10 Experts available now in Live!

Get 1:1 Help Now