Solved

referencing parent control

Posted on 2002-05-28
4
192 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
4 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7040429
:)
0
 
LVL 1

Accepted Solution

by:
zzconsumer earned 200 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 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…

863 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now