?
Solved

controls and properties

Posted on 1998-12-13
5
Medium Priority
?
167 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 200 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
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…
Suggested Courses
Course of the Month8 days, 17 hours left to enroll

764 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