Totalling 2 textboxes in a third text box

  • Thread starter Thread starter SueM
  • Start date Start date
S

SueM

Hi,

I want to know how to put the total of the values of 10
text boxes into an 11th textbox on a form.

I'm unsure about everything from where to put the event
(if I need to have one) to what signs to use.

I tried an equation in the default value property box. But
this didn't work (think my equation was too basic). I
tried adding ch box to the other ie
=[text1]+[text2] etc. The result returned was the value of
each textbox with a . before the next value of the next
textbox rather than a sum of all of them.

Is there a simple way to achieve the needed result?

Cheers Sue
 
Hey thanks for the advice.

I did this, but I get results as follows:
Text1 = 1.5
Text2= 1.3
Result=1.51.3 instead of 2.8

Is this likely to be because there is something else in
the property fields that I need to change? ie turn off or
on or something. I also tried throwing an Nz function into
the works but got the same result.
-----Original Message-----
Put your sum into the Control Source property box


-----Original Message-----
Hi,

I want to know how to put the total of the values of 10
text boxes into an 11th textbox on a form.

I'm unsure about everything from where to put the event
(if I need to have one) to what signs to use.

I tried an equation in the default value property box. But
this didn't work (think my equation was too basic). I
tried adding ch box to the other ie
=[text1]+[text2] etc. The result returned was the value of
each textbox with a . before the next value of the next
textbox rather than a sum of all of them.

Is there a simple way to achieve the needed result?

Cheers Sue

.
.
 
SueM said:
Hey thanks for the advice.

I did this, but I get results as follows:
Text1 = 1.5
Text2= 1.3
Result=1.51.3 instead of 2.8

Is this likely to be because there is something else in
the property fields that I need to change? ie turn off or
on or something. I also tried throwing an Nz function into
the works but got the same result.
-----Original Message-----
Put your sum into the Control Source property box


-----Original Message-----
Hi,

I want to know how to put the total of the values of 10
text boxes into an 11th textbox on a form.

I'm unsure about everything from where to put the event
(if I need to have one) to what signs to use.

I tried an equation in the default value property box. But
this didn't work (think my equation was too basic). I
tried adding ch box to the other ie
=[text1]+[text2] etc. The result returned was the value of
each textbox with a . before the next value of the next
textbox rather than a sum of all of them.

Is there a simple way to achieve the needed result?

Cheers Sue

.
.


The result you are getting shows that Access thinks your [text1] and
[text2] are text values not number values. Assuming that [text1] and
[text2] are values from those Fields in a Table, check to see what the
Field types are. You want them to be number types and, since you are
showing decimal values, the number type should be single or double, NOT
integer.

hth

Hugh
 
Further to what Hugh said, you can still convert the text to numbers, and do
the add, if you have to:

Result = Cdbl(Text1) + Cdbl(Text2)

The Cdbl function converts the text to double precision floating point.

But its still true that it might be better to hold the data as numerics
unless there is a good reason not to.

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
Hugh O'Neill said:
SueM said:
Hey thanks for the advice.

I did this, but I get results as follows:
Text1 = 1.5
Text2= 1.3
Result=1.51.3 instead of 2.8

Is this likely to be because there is something else in
the property fields that I need to change? ie turn off or
on or something. I also tried throwing an Nz function into
the works but got the same result.
-----Original Message-----
Put your sum into the Control Source property box



-----Original Message-----
Hi,

I want to know how to put the total of the values of 10
text boxes into an 11th textbox on a form.

I'm unsure about everything from where to put the event
(if I need to have one) to what signs to use.

I tried an equation in the default value property box.
But
this didn't work (think my equation was too basic). I
tried adding ch box to the other ie
=[text1]+[text2] etc. The result returned was the value
of
each textbox with a . before the next value of the next
textbox rather than a sum of all of them.

Is there a simple way to achieve the needed result?

Cheers Sue

.

.


The result you are getting shows that Access thinks your [text1] and
[text2] are text values not number values. Assuming that [text1] and
[text2] are values from those Fields in a Table, check to see what the
Field types are. You want them to be number types and, since you are
showing decimal values, the number type should be single or double, NOT
integer.

hth

Hugh
 
Back
Top