View Single Post
  #4   Report Post  
Posted to microsoft.public.word.docmanagement
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default Calculations in text form fields

Hi kmewing,

Have you protected the document for forms? If so, and you've follwed the previous directions exactly, it should work. The only other
thing I can think of that would prevent it working is if you've got mergefields (for a mailmerge) embedded in the same document.

--
Cheers
macropod
[MVP - Microsoft Word]


"kmewing" wrote in message ...
Thanks for the suggestions. I set up the file exactly as you described but I
still get the same behavior. The result field just shows zero regardless of
what values are entered into the drop-downs.


"macropod" wrote:

Hi kmewing,

First off, make sure you're using the 'legacy' dropdown formfields.

Next, with each dropdown formfield, make sure its properties include a bookmark name (eg DropDown1, DropDown2, DropDown3,
DropDown4,) and that it is set to 'calculate on exit'.

Then, where you want the calculation to go, press Ctrl-F9 to create a formula field coded as:
{=DropDown1+DropDown2+DropDown3+DropDown4}

You can also add formatting switches to the formula field - eg:
{=DropDown1+DropDown2+DropDown3+DropDown4 \# 0;(0)}
for whole numbers, with brackets around negative values
{=DropDown1+DropDown2+DropDown3+DropDown4 \# $,0.00}
for currency with a thousands separator

--
Cheers
macropod
[MVP - Microsoft Word]


"kmewing" wrote in message ...
I did a search of the forum on this topic and didnt find anything that
answered my question.

Im using Word 2007 but this also needs to work with 2003. I am revamping a
form that uses text form fields. Several of the fields are drop-downs where
you can choose a number (1, 2, 3, or 4). Another field is supposed to sum
the numbers from all the drop-downs.

I cannot get this operation to work. No matter how I configure the text
fields, the summation field just says zero.

Heres how Ive configured things. First, the drop-downs (assume three) are
just created normally (default settings). Second, the summation field is
configured as follows (in the Text Form Field Options dialog box):

Type: Calculation
Expression: =Dropdown_bookmark1+Dropdown_bookmark2+Dropdown_bo okmark3
Maximum length: Unlimited (default value)
All other fields blank.
€śCalculate on exit€ť is selected.

A colleague did some hacking and got the summation to work by making the
following changes in the Text Form Field Options dialog box:

Change the drop-downs to regular text form fields and set the Type to
Number.
In the summation field, enclose the Expression in parentheses, as in:
=(Textfield_bookmark1+Textfield _bookmark2+Textfield _bookmark3)
In the summation field, clear the text in the Bookmark field.

I could go this route, but I would prefer to keep the drop-downs if
possible. Does anyone have any advice? Thanks.