Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calculation of textbox problem

Status
Not open for further replies.

sdimaggio

Technical User
Jan 23, 2002
138
US
In the detail section of a report I created a textbox called [total] which added text boxes A and B.

[total]= [textbox A] + [textbox B]

[total] is in the detail section of the report

[textbox B] is a calculated textbox which is not in the query generating the report

I then tried to sum the textbox [total] in the footer by creating a textbox called [totalbilled] and then entering the following formula =Sum([total]).

My problem is I can not get it to sum the textbox I created which is [totalbilled]. However, if I add a textbox called [total A] and enter the formula =Sum([textbox A]) it works.

Why won't access sum a field I created in the report?





 
Hi,

Access doesn't keep track of the 'on report' calculated field you call 'Total' I suggest you buil another textbox in witch you will do the exact same thing as 'Total' except that you will turn the property 'Running sum' to OVER ALL and the visible property to false. then you just have to set 'TotalBilled' control source to =TextBoxYouJustCreated

and this should do!
If I'm not clear enough let me know!

Salvatore
 
Salvatore,

I need some more clarification

Thanks Steve
 
Hi,

Ok I'll try to be clearer.

To accomplish what you're trying to do you have to create another textbox witch is a copy of your textbox 'Total'. You will have to change the property RUNNING SUM of the textbox 'CopyOfTotal' to 'Over All' this will sum all the numbers shown in 'Total' each time a new 'Detail' is created. If you just run the report now you will notice that 'CopyOfTotal' as the value of the sum you're looking for. My suggestion for that is you turn 'CopyOfTotal' invisible and then link 'TotalBilled' Control Source property to '=CopyOfTotal' so that it shows the sum you calculated at the right place.

Hope this is of better help!

Salvatore
 
Hi Steve!

Another way to do it is to just recreate the calculation. If text box B calculates Rate*Hours then your total billing can be =Sum([textboxA] + Rate*Hours)

hth
Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top