Total Expression on Subform (1 Viewer)

Carol

Registered User.
Local time
Today, 06:53
Joined
Jan 15, 2000
Messages
280
I have a form which is in a tab layout form. (6 separate but related subforms) On one of the subforms, I have listed various item totals, which are then summarized with a grand total in the form footer. On another subform within the same, I would like to be able to bring this total over to be summarized within another grand total. My expression in my textbox in my final subform which I want to capture this total is as follows:
=[Forms]![Main Form]![Subform Name]![Subform Field Name]
translated into:
Main Form = Main Tab Form, "ConcernLog"
Subform = subform within a tab page "ConcernParts"
Subform Field Name = page footer "Total"

I keep getting the Name# error. I realize that Access 2000 is very strict about using the full path for these type of expressions, whereas in Access 2.0 and 97 it allowed you some leeway.

Any help would be appreciated, as it would save from entering this total manually.

Thanks.
 

Axis

Registered User.
Local time
Today, 06:53
Joined
Feb 3, 2000
Messages
74
use this sentax instead

=[Forms]![Main Form]![Subform Name].[Forms]![Subform Field Name]
 

Carol

Registered User.
Local time
Today, 06:53
Joined
Jan 15, 2000
Messages
280
Expression still does not work. I am trying to get a calculated total from one subform within a main form to be carried over to another subform also located within the main form.
Any further help would be appreciated.

Thanks.
 

Travis

Registered User.
Local time
Yesterday, 23:53
Joined
Dec 17, 1999
Messages
1,332
Axis you are very close with one subtle change:

=[Forms]![Main Form]![Subform Name].[Form]![Subform Field Name]

the second forms call should be form.

You can shortcut this code by using the Me property of the main form:

= Me.[Subform Name].[form]![Subform Field Name]

"Me = the main form"
 

Carol

Registered User.
Local time
Today, 06:53
Joined
Jan 15, 2000
Messages
280
Total is still not coming through - now I get a blank space. Any further suggestions. This one has me stumped.
Thanks
 

Travis

Registered User.
Local time
Yesterday, 23:53
Joined
Dec 17, 1999
Messages
1,332
=[Forms]![ConcernLog]![ConcernParts].[Form]![Total]

This should work. If it doesn't check the field/form names to make sure of spelling.
 

Carol

Registered User.
Local time
Today, 06:53
Joined
Jan 15, 2000
Messages
280
I think I found my problem. I need to create a running sum for my Concern Cost form.
My ConcernParts form is a continuous form which can have many lines. The individual line totals are calculated within my form query by a SubTotal field. This SubTotal field is then totalled for a Total which is what I want shown on the Concern Cost form. The problem I was getting was that by using the above expression, it was only picking up the first line of detail. That was okay if there was only one, but if there were numerous, it gave an incorrect amount.
I am now mixed between the following 2 expressions for a running sum - neither of which works:
=DSum("[Total]","ConcernParts","[ConcernID] = forms![Concern Costs]![ConcernID]") - This one references the ConcernParts form
or
=DSum("[SubTotal]","PartsforConcernLog","[ConcernID] = forms![Concern Costs]![ConcernID]") - This one references the underlying query and the field name.
Am I going in the right direction?
Again - thanks for all your help.


[This message has been edited by Carol (edited 02-13-2000).]
 

Carol

Registered User.
Local time
Today, 06:53
Joined
Jan 15, 2000
Messages
280
UPDATE: The following works:
=DSum"[SubTotal]","PartsforConcernLogQuery","[ConcernID] = [Forms]![Concern Log].form![Concern Costs]![ConcernID]")

Thanks for guiding me in the right direction.
 

Users who are viewing this thread

Top Bottom