Display subform calculations in main form

K

Ken

1) I have created a subform "SF-VisitDates" in a main form called
"Engineers"
I have managed to display a calculated subform value ("=Sum([G_Tot])" from
the subform form footer and named it "SG_Total" by putting the following
into a text box in the main form, "=[SF-VisitDates].Form!SG_Total" it
displays succesfully.

2)I have also created another form that has tab controls in it with the
subform "SF-VistDates" embeded in it. The tab control is called "TabCtl117"
How do I get the main form to display a calculated value from "SF-VistDates"
which is in "TabCtl117"
I have tried all sorts of combinations e.g.
"=[TabCtl117]![SF-VisitDates].Form!SG_Total" but it keeps crashing and tries
to send a report to Microsoft.

Regards
Ken
 
W

Wolfgang Kais

Hello Ken.
1) I have created a subform "SF-VisitDates" in a main form called
"Engineers"
I have managed to display a calculated subform value "=Sum([G_Tot])"
from the subform form footer and named it "SG_Total" by putting the
following into a text box in the main form,
"=[SF-VisitDates].Form!SG_Total" it displays succesfully.

2)I have also created another form that has tab controls in it with the
subform "SF-VistDates" embeded in it. The tab control is called
"TabCtl117" How do I get the main form to display a calculated value
from "SF-VistDates" which is in "TabCtl117". I have tried all sorts
of combinations e.g. "=[TabCtl117]![SF-VisitDates].Form!SG_Total"
but it keeps crashing and tries to send a report to Microsoft.

Try this (Assuming that the name of the page is MyPage):
=[TabCtl117].Pages!MyPage.Controls![SF-VisitDates].Form!SG_Total

-
Regards,
Wolfgang
 
K

Ken

Thanks for the sugestion Wolfgang.
I dont understand the refereanve to Page.

I assumed that I have to refer to fom names.
Regards
Ken
Wolfgang Kais said:
Hello Ken.
1) I have created a subform "SF-VisitDates" in a main form called
"Engineers"
I have managed to display a calculated subform value "=Sum([G_Tot])"
from the subform form footer and named it "SG_Total" by putting the
following into a text box in the main form,
"=[SF-VisitDates].Form!SG_Total" it displays succesfully.

2)I have also created another form that has tab controls in it with the
subform "SF-VistDates" embeded in it. The tab control is called
"TabCtl117" How do I get the main form to display a calculated value
from "SF-VistDates" which is in "TabCtl117". I have tried all sorts
of combinations e.g. "=[TabCtl117]![SF-VisitDates].Form!SG_Total"
but it keeps crashing and tries to send a report to Microsoft.

Try this (Assuming that the name of the page is MyPage):
=[TabCtl117].Pages!MyPage.Controls![SF-VisitDates].Form!SG_Total

-
Regards,
Wolfgang
 
W

Wolfgang Kais

Hello Ken.

Ken wrote:
[...]
I have also created another form that has tab controls in it with the
subform "SF-VistDates" embeded in it. The tab control is called
"TabCtl117" How do I get the main form to display a calculated value
from "SF-VistDates" which is in "TabCtl117". I have tried all sorts
of combinations e.g. "=[TabCtl117]![SF-VisitDates].Form!SG_Total"
but it keeps crashing and tries to send a report to Microsoft.
Try this (Assuming that the name of the page is MyPage):
=[TabCtl117].Pages!MyPage.Controls![SF-VisitDates].Form!SG_Total
I dont understand the refereanve to Page.

A tab control has a pages collection (the tabs) and every page has a
name. In my example, I assumed that the name of the page that contains
the subform control was MyPage and that the subform control on
that page was named [SF-VisitDates].
Eplanation:
"=[TabCtl117]" : The tab control
".Pages" : The Pages collection of the tab control
"!MyPage" : The page MyPage
".Controls" : The controls collection of that page
"![SF-VisitDates]" : The subform control on that page
".Form" :The source form contained in the subform control
"!SG_Total" : a control on 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