Solved

UserControl problem

Posted on 2004-10-21
4
240 Views
Last Modified: 2010-05-02
Hello everybody,

  I'm inside a UserControl. I want to pass this UserControl object from my UserControl to a
function located outside this UserControl object. How can I get it so I can later access some
UserControl's functions?

  Thanks in advance
0
Comment
Question by:JonGartzia
4 Comments
 
LVL 6

Expert Comment

by:mmusante
ID: 12368065
Sorry but I don't understand ... can you post an example?
0
 
LVL 16

Expert Comment

by:jimbobmcgee
ID: 12368148
Have you tried:

     Private Sub UserControl_SomeEvent()

           Call ExternalRoutine(Me)

     End Sub

     Public Sub ExternalRoutine(ByRef ctl As UserControl)

           'YOUR CODE

     End Sub

Failing that, you could always try using:

     Public myUserControl As UserControl

in your Declarations section...


HTH

J.
0
 
LVL 26

Accepted Solution

by:
EDDYKT earned 125 total points
ID: 12368778
0
 
LVL 1

Author Comment

by:JonGartzia
ID: 12369307
Thank EddyKT. Seems to work.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…

856 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