Solved

Control Names

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA error replacing data 6 39
Visual Basic Excel Formatting error 4 101
Looking for VB6 code to read SQL table export it to ascii 8 38
Protecting vb6 & .Net code Obfuscation 18 121
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

816 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

13 Experts available now in Live!

Get 1:1 Help Now