Solved

Control Names

Posted on 2001-06-21
2
156 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
Comment Utility
For Each c In Controls
        List1.AddItem c.Name
    Next
0
 
LVL 6

Expert Comment

by:simonbennett
Comment Utility
...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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

771 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