Simple addition on form only?

MARKYB0Y

Registered User.
Local time
Today, 23:44
Joined
Jun 28, 2008
Messages
18
Hi All,

I have several text boxes on a form which are editable in my database, I would like to have a running total of these values on the form, the total is not needed in the database as the individual values are fine, how do I do this?

I assume it is based on the control source of the textbox?

I have tried =[S1]+[S2]+[S3]+[S4]+[S5]+[S6]

however this just concatenates the fields and displays all 6 values as a long number, I need it to add the values together

ok, even more annoying I have just tried using multiplication (*) Minus (-) and Division (/) and they all work great!

how do I get it to sum the values instead of placing them next to each other?

Thanks in advance
 
Last edited:
If it's concatenating them, it thinks they're text values. Try wrapping each in the appropriate conversion function, like:

=CCur([S1])+CCur([S2])...
 
If it's concatenating them, it thinks they're text values. Try wrapping each in the appropriate conversion function, like:

=CCur([S1])+CCur([S2])...

That's the likely thing is that they ARE stored as text. If they are numbers they should really be stored as numbers.

You can also use Val([S1])+Val([S2])...

But I would change the datatype in the table if possible so as to avoid any inconsistencies, if you have the opportunity to do so. Then you won't have to worry about that anymore.
 
Hi Guys, correct the columns of the table were text instead of number (weird that it can still divide, multiply and minus text values though?)

anyway it is now adding all 6 values just great, however is it possible for it to add the values as it goes along? so if S1 and S2 are filled in it will total even though 3-6 are still blank?

and finally, once i have these textboxes with values, is it possible to add the textboxes together for a grand total? (baring in mind these values are not in the database, only on the form) this is purely cosmetic but if it can be done great!

thanks
 
Didnt see BOB's response, using the VAL infront of the textbox names does the addition as required

so just the totalling as values are entered if possible !
 
Hi All,

I have several text boxes on a form which are editable in my database, I would like to have a running total of these values on the form, the total is not needed in the database as the individual values are fine, how do I do this?

I assume it is based on the control source of the textbox?

I have tried =[S1]+[S2]+[S3]+[S4]+[S5]+[S6]

however this just concatenates the fields and displays all 6 values as a long number, I need it to add the values together

ok, even more annoying I have just tried using multiplication (*) Minus (-) and Division (/) and they all work great!

how do I get it to sum the values instead of placing them next to each other?

Thanks in advance
Try =Sum[S1]+[S2]+[S3]+[S4]+[S5]+[S6]
 
I already did that, when you enter the SUM Access removes it to just leave =[S1]+ etc

so still the problem that it will add the 6 filds but only if they all have a laue in.

I still need it to add the 6 fields even if some are blank

thanks
 
I already did that, when you enter the SUM Access removes it to just leave =[S1]+ etc

so still the problem that it will add the 6 filds but only if they all have a laue in.

I still need it to add the 6 fields even if some are blank

thanks
Try this:

=Nz([LoanAmt])-NZ([UnpdPB])-NZ([CurrReq])

Change the minus to plus and add three more fields. I assume you have a seventh field that is taking in the calculation. Change the names in the brackets to your names. I have never had a problem with this formula and don't think it is number specific (ie.., limited to number of fileds it will calculate). the NZ just means if the field is zero it will not disrupt the formula so you don't have to have a number in the field for it to be included. Make sure your fields are set to number and not text.
 

Users who are viewing this thread

Back
Top Bottom