Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


UserControl problem

Posted on 2004-10-21
Medium Priority
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
Question by:JonGartzia
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

Expert Comment

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

Expert Comment

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...


LVL 26

Accepted Solution

EDDYKT earned 500 total points
ID: 12368778

Author Comment

ID: 12369307
Thank EddyKT. Seems to work.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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

688 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