jelwp was telling us:
jelwp nous racontait que :
The user can't enter decimals, only whole numbers. But by nature of
the math, when calculating 3%, there is usually a decimal involved.
I keep all the numbers as whole numbers, and I want to be sure that
the math adds up properly when the decimals are dropped.
The easiest is to add your formfields, then, to access their properties,
double click on the ones the user will use to enter numerical data. Select
"Number" as type and in the Format drop down, choose the currency one, once
it is selected, go in the field and remove the decimal separator and the
decimals. If you have a lot of formfields to format that way, just copy the
first format you customize and then paste it in the other formfields. Also,
while in the property dialog, give your formfields descriptive name in the
Bookmark field, names other than "Text1", "Text2", etc.
For the results fields, use "Calculation" as type, use the same format, and
in the Expression field, enter something like: =Textfield1*0.03 (Where
"Textfield1" is the bookmark name of a formfield).
Finally, at least one of the user-entered number fields should have the
"Calculate on exit" box check so that the Calculation fields update
automatically as the user navigates through the form.
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site:
http://www.word.mvps.org