?
Solved

is there a way to find the control is Menu?

Posted on 2003-03-31
9
Medium Priority
?
149 Views
Last Modified: 2010-05-01
is there a way to find out to loop thru all the controls in a form and say "this is Menu"?

0
Comment
Question by:VijayK
[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
9 Comments
 

Author Comment

by:VijayK
ID: 8243726
Soory to ask this simple Q. I got it.
0
 
LVL 53

Accepted Solution

by:
Ryan Chong earned 200 total points
ID: 8243731
Try:

Private Sub Command1_Click()
    Dim c As Control
    For Each c In Me.Controls
        Debug.Print c.Name & ": " & TypeName(c)
    Next
End Sub

cheers
0
 

Expert Comment

by:pkmnfrk
ID: 8250430
Private sub FindMenu()
    Dim ctrl As Control
    For Each ctrl In Controls
        If TypeName(ctrl) = "Menu" Then
            'Do what ever you want
            MsgBox "I found the menu!"
        End If
    Next
End Sub

When for each menu it finds, it'll do whatever is in the If block.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 53

Expert Comment

by:Ryan Chong
ID: 8250484
VijayK, feel free to accept an answer or post a request delete this question at Community Support.

http://www.experts-exchange.com/Community_Support/

cheers
0
 

Expert Comment

by:CleanupPing
ID: 8531218
Hi VijayK,
This old question (QID 20569706) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 9017740
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept answer by ryancys
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GrahamSkan
EE Cleanup Volunteer
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 9018619
Sorry to particiapte here
I am wondering.
If we make this as PAQ'ed/points not refunded is right choice. Because actually this is solved by questioner and not requested for deletion

0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 9018722
Hi sudhakar_koundinya,

Don't feel sorry about participating. It's good to know that someone is taking an interest.

I gather you think that the "I got it" in  VijayK's comment meant that he had found the answer. You may be right. Vijay himself could have asked for a refund, but possibly didn't know how to. If he posts in the few days, we'll change it to PAQ with refund.
Cheers, Graham
0
 

Expert Comment

by:YensidMod
ID: 9115281
There is a doubt whether "I got it" means asker really got the answer. If in doubt, I like to reward those who take the time to answer the question.  As recommended, points to ryancys.

YensidMod
EE Moderator
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…
Suggested Courses

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