UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Summing a Field    
 
   
tair23
post Oct 24 2007, 10:15 AM
Post #1

UtterAccess Guru
Posts: 652
From: Indiana



I have a report, with detail lines. In each detai line I have a multiplier and a base amount. I multiply the 2 numbers and put them in a textbox. This works great. However I need to total the amounts in the text box at the bottom of the report. =Sum([text42]) Doesnt work and it asks me to pop u late text 42 via a pop up box. Text42 is the text box that holds the answer to the multiplier and the base amount being multiplied. I figure you can't sum a calculated box. I am sure there is way to do this thanks for your help.
Go to the top of the page
 
+
fkegley
post Oct 24 2007, 10:17 AM
Post #2

UtterAccess VIP
Posts: 23,583
From: Mississippi



This might work:

In the Control Source of the text box in the report footer:

=Sum([Field1] * [Field2])

where Field1 and Field2 are the fields being used to get the value in text42.
Go to the top of the page
 
+
tair23
post Oct 24 2007, 10:22 AM
Post #3

UtterAccess Guru
Posts: 652
From: Indiana



=Sum(([text36]*[SURFACETONS])+([text36]*[basetons]))

Is my code. Now Text36 is an unbound textbox that has Code written behind it to find the multiplier and hold it for each record.

It does not display anything and it ask me to input text36 with a pop up box
Go to the top of the page
 
+
tair23
post Oct 24 2007, 10:23 AM
Post #4

UtterAccess Guru
Posts: 652
From: Indiana



Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim varX As Variant
varX = DLookup("[pavingrate]", "tbl_PavingRatesByYear", "[pavingyear] = " _
& Reports!rpt_PavingArchive!Text38)

Text36 = varX


End Sub

Is how text36 gets its multiplier
Go to the top of the page
 
+
tair23
post Oct 24 2007, 10:47 AM
Post #5

UtterAccess Guru
Posts: 652
From: Indiana



Could I add a text box on each record that would keep a running total?
Go to the top of the page
 
+
fkegley
post Oct 25 2007, 08:53 AM
Post #6

UtterAccess VIP
Posts: 23,583
From: Mississippi



Yes you can do that.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 20th June 2013 - 05:39 AM