?
Solved

Referencing a UserControl from a Module

Posted on 2003-03-28
4
Medium Priority
?
182 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
[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
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

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