is there a way to find the control is Menu?

is there a way to find out to loop thru all the controls in a form and say "this is Menu"?

VijayKAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

VijayKAuthor Commented:
Soory to ask this simple Q. I got it.
0
Ryan ChongCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pkmnfrkCommented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Ryan ChongCommented:
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
CleanupPingCommented:
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
GrahamSkanRetiredCommented:
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
sudhakar_koundinyaCommented:
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
GrahamSkanRetiredCommented:
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
YensidModCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.