?
Solved

referencing parent control

Posted on 2002-05-28
4
Medium Priority
?
197 Views
Last Modified: 2010-05-02
I've written a control which is invisible at runtime.

The control itself has nothing but a label on it.

The user interface, which can be invoked by the parent application, consists of two forms within the control.

I need to be able to fire events from code on one of those forms, and to access the control's custom properties. To do this I need to reference the control itself from a constituent form - how is this done?

TIA
0
Comment
Question by:nedrub
[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
4 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7040429
:)
0
 
LVL 1

Accepted Solution

by:
zzconsumer earned 800 total points
ID: 7041135
If I understand right what you need, you should do the following:

In the form that needs the reference, do the following:

1. Add a private variable of the type your referenced element is of:
private myControl as myControlElement (or whatever)

2. Add a Property to the Form:
Public Property Let TheControl (tControl as myControlElement)
Set myControl = tControl
End Property

3. From somewhere in your Program, use:
Form1.TheControl = TheControlWhichIsVisibleToTheProgramFromHere
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7851211
Hi nedrub,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept zzconsumer's comment(s) as an answer.

nedrub, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 7912832
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
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

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…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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 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…
Suggested Courses

764 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