suming up text box from other text boxes that have a sum formula

  • Thread starter ryan.fitzpatrick3
  • Start date
R

ryan.fitzpatrick3

I have three text boxes, i.e. "text box C" that sums up "text box A"
and "text box B".

I have a text box at the bottom of the sub form that sums up the
values for "text box C"
Text box C is called tboxextcost.

so I did =sum([tboxextcost]) but the result gives a 0 back. What am I
doing wrong? Thanks.

Ryan
 
R

ryan.fitzpatrick3

That didn't work. It gave an error.

textboxa = tboxPercofComp
textboxb = UnitPrice
textboxc = ExtCost <--sums up a * b = c

At the bottom of the form page is a textboxd = extcosttotal
this should sum up all the ExtCost text boxes, but like you mentioned
since it's not on a record of any kind it shows up as a blank, but
since I put =Sum(Nz([ExtCost],0)) it shows up as 0. I did what you
mentioned for the extcosttotal text box and put =Sum(tboxPercofComp*
UnitPrice) but this gave me an error.

Ryan


I have three text boxes, i.e. "text box C" that sums up "text box A"
and "text box B".
I have a text box at the bottom of the sub form that sums up the
values for "text box C"
Text box C is called tboxextcost.
so I did =sum([tboxextcost]) but the result gives a 0 back. What am I
doing wrong? Thanks.

I would have expected an error from that. The aggregate
functions( Count, Sum, etc) only operate on fields in the
form/report record source table/query. They are unaware of
controls in a form/report.

Instead of:
=Sum(tboxextcost)

Assuming the expression in tboxextcost is
=txtboxA + txtboxB
then you should use:
=Sum(txtboxA + txtboxB)
 
R

ryan.fitzpatrick3

Got it thanks!!

That didn't work. It gave an error.
textboxa = tboxPercofComp
textboxb = UnitPrice
textboxc = ExtCost <--sums up a * b = c
At the bottom of the form page is a textboxd = extcosttotal
this should sum up all the ExtCost text boxes, but like you mentioned
since it's not on a record of any kind it shows up as a blank, but
since I put =Sum(Nz([ExtCost],0)) it shows up as 0. I did what you
mentioned for the extcosttotal text box and put =Sum(tboxPercofComp*
UnitPrice) but this gave me an error.

You can not use (text box) ***controls*** in an aggregate
function.

I still don't know what the names of the record source
***fields*** are, but I'm guessing it should be:

=Sum(PercofComp * UnititPrice)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top