Adding Unbound Text Fields to Each Other

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have a section on my form where users input the number of stores in each
of three areas. I want to have a TOTAL STORES item on there, but when I try
to input the formula =[numStore1]+[numStore2]+[numStore3] I get a reponse
that looks like "505050" instead of "150" which is what 50 + 50 + 50 would
be. How can I correct this?

Thanks!
 
You need to ensure that the contents gets treated as numbers.

Since the values always going to be integer values, try
=CInt([numStore1])+CInt([numStore2])+CInt([numStore3])
 
Jennifer Cali said:
Hi,
I have a section on my form where users input the number of stores in each
of three areas. I want to have a TOTAL STORES item on there, but when I
try
to input the formula =[numStore1]+[numStore2]+[numStore3] I get a reponse
that looks like "505050" instead of "150" which is what 50 + 50 + 50 would
be. How can I correct this?

It appears you are concatenating text instead of adding numbers. Are
[numStore1], [numStore2], and [numStore3] the names of Fields in the Form's
RecordSource, or are they the names of Controls on the Form? Are you
"inputting the formula" in the ControlSource property of "TOTAL STORES"
Control or elseswhere? Are the Fields in the Form's RecordSource that apply
to these defined as Text or Numeric?

Larry Linson
Microsoft Access MVP
 
Hi Larry,
The [num...] are fields on the form - not stored in a table & don't need to
be. I just need calculations to occur against these values. They are set to
numeric type and I've been inputting the values into the "Control Source"
under properties.
--
Thank you! - Jennifer


Larry Linson said:
Jennifer Cali said:
Hi,
I have a section on my form where users input the number of stores in each
of three areas. I want to have a TOTAL STORES item on there, but when I
try
to input the formula =[numStore1]+[numStore2]+[numStore3] I get a reponse
that looks like "505050" instead of "150" which is what 50 + 50 + 50 would
be. How can I correct this?

It appears you are concatenating text instead of adding numbers. Are
[numStore1], [numStore2], and [numStore3] the names of Fields in the Form's
RecordSource, or are they the names of Controls on the Form? Are you
"inputting the formula" in the ControlSource property of "TOTAL STORES"
Control or elseswhere? Are the Fields in the Form's RecordSource that apply
to these defined as Text or Numeric?

Larry Linson
Microsoft Access MVP
 
Thanks, that works perfect. Issue solved.
--
Thank you! - Jennifer


Douglas J. Steele said:
You need to ensure that the contents gets treated as numbers.

Since the values always going to be integer values, try
=CInt([numStore1])+CInt([numStore2])+CInt([numStore3])

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Jennifer Cali said:
Hi,
I have a section on my form where users input the number of stores in each
of three areas. I want to have a TOTAL STORES item on there, but when I
try
to input the formula =[numStore1]+[numStore2]+[numStore3] I get a reponse
that looks like "505050" instead of "150" which is what 50 + 50 + 50 would
be. How can I correct this?

Thanks!
 

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

Back
Top