Solved

controls and properties

Posted on 1998-12-13
5
160 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
5 Comments
 
LVL 2

Expert Comment

by:JiaH
Comment Utility
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
Comment Utility
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
Comment Utility
Jiah are wrong
Eyal is making life to difficult, there is an easier answer.

0
 

Accepted Solution

by:
fduah earned 100 total points
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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.
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…

762 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

12 Experts available now in Live!

Get 1:1 Help Now