Solved

referencing parent control

Posted on 2002-05-28
4
191 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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.
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…
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…

707 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

11 Experts available now in Live!

Get 1:1 Help Now