Solved

controls and properties

Posted on 1998-12-13
5
166 Views
Last Modified: 2013-11-25
a) how do I get the names of the controls on a form?

b) how do I get the names of the properties of each control?
0
Comment
Question by:dcsorillia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 2

Expert Comment

by:JiaH
ID: 1449874
For (a) , you can use the controls collection to get each item in it such as "For each ctrX in me.controls" , the control's name is ctrX.name.

For (b) Vb don't support this.
0
 
LVL 15

Expert Comment

by:Eyal
ID: 1449875
For part a JiaH is correct but for part b of your question he is wrong. You can get all the properties and methods From the IDE in add-ins component or from microsoft unsuported dll
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1449876
Jiah are wrong
Eyal is making life to difficult, there is an easier answer.

0
 

Accepted Solution

by:
fduah earned 100 total points
ID: 1449877
here are your answers:
(a)
   dim ctrl as control
   for each ctrl in form.controls
      msgbox ctr.name
   next

b(b)
  dim pr as property
    for each pr in control
       msgbox  pr.name
    next



0
 

Author Comment

by:dcsorillia
ID: 1449878
fduah,

The first part of your answer works correctly.  I knoew that was the easy part.  

As for the second part:

Dim pr as property  <-- vb reports that property is an undefined user type.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…

724 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