drop down Form fields being used for calculation

O

OTWarrior

I want to use 2 drop down form fields in a calculation, to multiply one by
the other.
The drop down fields may contain text (eg: "15 mins" or "N/A"), however the
calculation field i have can display this infomation.

I have looked elsewhere, and can see that { =({REF Dropdown1}*10)} could
somehow be used, but am unsure if i put it in (behind using alt F9) the drop
down box or the end calculation box.

also, is it possible to use a calculated form field to draw from another
calculation? as when i try having it, very werid values come up.
ie:
text1: "2"
calc1: "=1+2"
calc2: =product(calc1,text1) result = "22"
 
P

Peter Jamieson

As far as I know you won't be able to retain the text in your calculation.
You essentially take a chance that Word will correctly extract the number
from whatever the user types and use that to perform the calculation.
e.g. "15 mins", "15mins" and "mins 15" are all recognised as 15, but
"mins15" evaluates to 0 (these are in text format fields of course.

In should be recognised as 15, as should "mins15", but "15mins" will be
recognised as 15.

if you use a numeric format field, things can get weird straight away. For
example, all the above texts will be stripped down to 15 when the user
navigates away from the field. If you enter any letter followed by a digit -
a1,b1,...,z1 - the letter is stripped off and you are left with 1, unless
it's "h" or "t", in which case the "number" is left as h1 or t1 and
evaluates as 0. In fact you can type in any number of ts and hs and they
don't go away. I don't know why.

Although you can use literal text in the calculated output using numeric
picture switches e.g. #\"0.00 'mytext'", I don't know of a way you can
re-use the text that someone typed as part of your number field or indeed
any other form field. You'd have to get them to type it into a separate
field and replicate it using a { REF } field after your result form field.
The main reason for that is that you can't get the special ctrl-F9 field
code braces into the switch, which is why you also can't do this:

{ =({REF Dropdown1}*10)}

I think you'd have to write a VBA macro to do that. But I'm no expert as far
as these forms are concerned. Be aware that (AFAIK) you won't be able to do
any of that stuff using VBA in the next Mac version of Word - for one think,
I'm not sure these forms will be in that version at all, and for another
there will be no VBA, and I don't know whether it would in any case be
possible to specify any other type of scripting macro in the properties of
form fields (if they exist).

Peter Jamieson
 
P

Peter Jamieson

<<
unless
it's "h" or "t", in which case the "number" is left as h1 or t1 and
evaluates as 0. In fact you can type in any number of ts and hs and they
don't go away. I don't know why.
But apprarently this doesn't occur on Mac Word 2004.

Peter Jamieson
 

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