[AccessD] Raising events from a subform and sinking them in the parent form

John W Colby jwcolby at gmail.com
Mon Mar 24 15:53:08 CDT 2014


I haven't tried it in 2010 / 2013. However any form (including a subform) IS a class.  You would 
need to set a WithEvents variable in the parent class and set it to point to the child form.  Then 
you should be able to sink the events.  Don't forget to destroy the pointer when you close the 
parent form.

When you set the pointer I think you use the syntax something like:

Dim withevents MySFrm as form_MySubFormName
set MySFrm = MyParentForm!MySubformCtl.Form

Or something close to that.  The above is pure air code.

If you succeed in getting the above syntax working then the subform will be available in the 
controls combo in the code module.  You can select it just as you would a combo or other control, 
then select the Events combo and and select the event you want to sink.

John W. Colby

Reality is what refuses to go away
when you do not believe in it

On 3/24/2014 4:23 PM, Charlotte Foust wrote:
> I know I've done this before but it probably required a class, which I
> hesitate to use in this app.  Has anyone else had problems raising and
> sinking events between forms in Access 2010/2013?
>
> Charlotte


---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com



More information about the AccessD mailing list