calling a method on a parent form

G

Guest

i have a subform called ProductOrder Subform1 and a parent called order form
and i have a button on the parent the recalculated the costs of the subform.
i want to make the parent recalc everytime something on the subform changes
but i dont know how to call the parent from the subform. cheers
 
A

Allen Browne

To answer the questions you asked:

a) To call a funtion named MyCalc() in the Form1's module:
Call Form_Form1.MyCalc()
Make sure there is not Private in front of the Sub/Function declaration.

b) Every time you save a change in the subform, its Form_AfterUpdate event
fires.

It's not clear what you are recalculating in the main form. Hopefully you
are not doing something like storing the total of the subform's related
records back in the main form's table. That would violate the most basic
rules of normalization, and your chances of messing things up is signficiant
(e.g. do you handle it when you delete a row from the subform?)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top