get reference of the containing form

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Neo (neo_at_learning.net)
Date: 01/15/05


Date: Sat, 15 Jan 2005 13:57:56 +1100

I am trying to create a custom control, & in this control i need to access
the form where this control is added.
How can i do this.

- I tried to accept a new parameter in the constructor of this new control,
but then i can't drop the control onto the form.
- I don't want to drop the control onto the form & set the reference to the
form in a property of the control from code, because if i want to drop this
control 10 times in 10 forms, then this means that i will always have to set
the reference of the form in a property of this control.

I just want to access the form from my control & do not want to put ANY code
in the form (but only have to be able to drop this control on the form and
this will be enough)

How can i resolve my problem.



Relevant Pages

  • Re: Funky error loading form
    ... I first followed your suggestion, ad that did not resolve the issue, but it ... After your suggestion didn't work, ... I added a reference, and successfully inserted the control into a new form. ...
    (microsoft.public.vb.controls)
  • RE: Built in function errors.
    ... located on other tabs in a tab control. ... I had to find a way to use the reference. ... TLBs on the client computer. ... reselect libraries simply makes the application not worth building using ...
    (microsoft.public.access.modulesdaovba)
  • Re: Reference forms and fields with variables
    ... There are so many ambiguities here, that it may not really help to follow ... If Field2 is a field in the underlying recordset, ... but the reference is unstable. ... LinkChildFields property of a subform is NOT represented by a control in the ...
    (microsoft.public.access.formscoding)
  • RE: f7s4r4v
    ... speaking this is a reference to the current instance of the class, ... Similarly any references to a control on the form simply by the ... Private Sub Form_AfterUpdate ... intSecond As Integer) ...
    (microsoft.public.access.gettingstarted)
  • Re: Referencing problem
    ... Re:> Activecontrol does not return the correct reference for controls ... Dim ctlSpell As Control ... If TypeOf ctlSpell Is TextBox Then ... If the tab is on a subform, ...
    (comp.databases.ms-access)