calculation in tab control page

U

Ulrich1947

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
 
W

Wayne Morgan

+ 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])
 
U

Ulrich1947

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
 

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