View Single Post
  #3  
Old May 12th, 2010, 05:58 PM posted to microsoft.public.access.forms
NFL
external usenet poster
 
Posts: 74
Default Running Total from a Subform

That worked! I repeated the calculation. Thank you and please pass my
thanks to the Database Team for all their help!

"BruceM via AccessMonster.com" wrote:

You need to repeat the calculation, not reference the calculated control.
TextBox26 would need to be:
=Sum([UnitPrice]*[UnitsOrdered])

If you perform the UnitPrice*UnitsOrdered calculation in the subform's record
source query you can use Sum on the calculated field, but as you have
described it you need to sum the calculation as shown.

You can reference the text box from the main form by using the following as
the Control Source of an unbound text box on the main form:

=Forms!MainFormName!SubformControlName.Form!TextBo x26

Actually, you should be able to use a shorter version of the expression:

=SubformControlName.Form!TextBox26

NFL wrote:
I have a unbound control box (called textbox 20) in the details section on my
subform that calculates unit price and units orders. The data source looks
like this ...=[UnitPrice]*[UnitsOrdered]

I want to get a running total set up on my main form. Before I do that I'm
pretty sure I need to set up my header on the subform. In my subform, I
entered another unbound textbox (called textbox 26) on the header with a
datasource that looks like this =sum([textbox20]).

Both of these control boxes are set to currency and when I try to preview
the form, my header gives me a #Error.

Thank you for your help!


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201005/1

.