?
Solved

Referencing a UserControl from a Module

Posted on 2003-03-28
4
Medium Priority
?
185 Views
Last Modified: 2010-05-01
Im sure that one of you will know the answer to this seemingly simple question.

I have an ActiveX Control project that contain a Menu object. The project also has a Module. How do I reference the PopupMenu method of the UserControl from the Module?
I would have liked to have used the UserControl instance then the method name:

UserControl1.PopupMenu

If the control had been a Form then Form1.PopupMenu in a module works fine.

Thanks

-Rob
0
Comment
Question by:polyorchid2
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
VK earned 280 total points
ID: 8224298
Hello polyorchid2 !

In fact it's easy:

1. In the *.ctl File of your ocx-Project:
 Public Sub Popupmenue
   usercontrol.popupmenue
 end sub

V.K.
0
 
LVL 6

Expert Comment

by:VK
ID: 8224323
This was the way you can call the popupmenue outside the ocx. If you want to call the popupmenue inside of the ocx from a module:

1. In the *.ctl File of your ocx-Project:

Private Sub UserControl_Initialize()
  Set myPopup = UserControl.myMenue
End Sub

2. In the *.bas File of your ocx-Project:

Public myPopup As Menue

Sub blabla
  Popupmenue myPopup
end sub

V.K.
0
 

Expert Comment

by:CleanupPing
ID: 8531436
Hi polyorchid2,
This old question (QID 20566174) 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 6

Expert Comment

by:GPrentice00
ID: 9440842
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 VK's comment as Answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer
0

Featured Post

Industry Leaders: 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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

621 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