Well,
I changed Value1 to my field name.
I have the field set as number, format 0.00%, macro on exit is
divide100.
When I run it, I get a type mismatch error. Looking at the macro,
I'm not sure why ? Form field is type number. Is the macro assuming
the field is text ?
"Jean-Guy Marcil" wrote in message
...
Darryl was telling us:
Darryl nous racontait que :
Thanks Anne.
I understand that 8.7 is not 8.7%. But as the users say, I need it
this way.
I don't know how to make it such that when the user leaves the field
in the table, that the resulting value (870%) is divided by 100 so it
shows 8.7% (the goal).
Here is a little macro that does that:
'_______________________________________
Sub Divide100()
Dim myValue As Single
With ActiveDocument.Bookmarks("Value1").Range
myValue = CSng(Left(.Text, Len(.Text) - 1))
myValue = myValue / 10000
.FormFields(1).Result = CStr(myValue)
End With
End Sub
'_______________________________________
Note that I have to divide by 10 000 because when I do the calculation,
the
number entered by the user a=has already been multiplied by a 100 because
of
the number format...
The formfield name is Value1.
Either change the name in the macro, or change it in the form itself.
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
ISTOO
Word MVP site: http://www.word.mvps.org