Refer to subform

mdo

Registered User.
Local time
Today, 09:37
Joined
Aug 17, 2003
Messages
13
Hi!

I have a main form with a subform. I would like to get a total from my subform to put in a field on the main form. I tried the following but it doesn't work:

forms!frmmain!sfrmsubform.form!total

Please help.

Is it possible to get the default value from a query instead of the above eventhough the main form is linked to a table? Just a thought.

Thanks!
 
I suppose your Parent form is like a grand total (Bill), and your (Child) Subform is like a rule on the bill, and you would like to get the sum of rules displayed in your Parent window...

What I would do is:
Create a query which calculates the sum, and refer your form to the same options as you do when creating a subform.

Don't know if this solves your question, but I certainly hope so.
 
Do you have the = sign, or did you just forget to post it?
 
I was at the Microsoft Developer net site and found the attached document describing how to address fields and controls in forms & subforms. Problem is, I found in my report these rules did not work well. Perhaps in forms they will work.

What worked for me:
On the main report I had a text box which calculates the remaining credit requirements for a student.
=Subreport Field - Sumation field on main report

exact syntax:
=nz([rsubCollegeCourseCohort].Form![PHI Req]-[PHI hours Grand Total Sum])

in psuedo english to access the field value on the subreport:
[subReport].Form![fieldOnSubReport]
 

Attachments

Users who are viewing this thread

Back
Top Bottom