Solved

referencing parent control

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…

821 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