calculation in tab control page

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

Guest

Hi all,
on a tab control page in a form i do have several textboxes in which one can
fill numbers to be added, subtracted, divided or multiplied, just like a
calculator; the result is shown in another textbox.

e. g. textboxes named re6 and re8 get filled with 5 and 6, in textbox re10 i
have a formula, reading: "=[re6]+[re8]" which leads in the forementioned case
to the result of 56 instead of 11.

If I try the same with operators "*", "-" or "/" it works fine, if I make it
very simple "=5+6" I also get the correct result. Eventually, if I do this
outside the tab control for other controls within the same form, it works
properly too.

It seems, in case of a "+" referring to the name of controls, the entries
are connected in a "&"-operator manner.

What do I do wrong ?

Ulrich
 
+ and & can be used for concatenation, although + will normally result in an
arithmetic operation if the text value can be converted to a number.
However, it doesn't appear to be happening automatically in this case, so
you may need to specify that it do so.

Try:
=Val([re6]) + Val([re8])
 
Thanks a lot. it works. i should have known. i tried nearly everything -
except, what i should have tried in the first place.

Sorry, it was'nt my day. thanks again.

Ulrich
 
Back
Top