Solved

UserControl problem

Posted on 2004-10-21
4
239 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

809 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