Thread: cell formatting
View Single Post
  #18   Report Post  
Darryl
 
Posts: n/a
Default



I created a brand new document with a table (inserted from the
forms toolbar) that had three columns. first, I put the insertion point
into column 1 row 1. Then selected text form field from the forms toolbar.
I then right clicked, chose properties and set the a field type to number.
Text format to 0.00%. Selected divide100 as the exit macro. Under the
field settings group box I set the bookmark to value1. Clicked OK.
Clicked form protect button on forms toolbar.

Then to test, put insertion point in column1 row 1 and typed 1.23 then
pressed the tab key. Immediately the type mis-match error 13 pops up.
press debug on the error dialog box and the debugger says the offending is:
myValue = CSng(Left(.Text, Len(.Text) - 1))

what am I doing wrong ?

thanks,
Darryl

"Jean-Guy Marcil" wrote in message
...
Darryl was telling us:
Darryl nous racontait que :

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 ?


I created a protected form with a text field set to number with the 0.00%
format, then I protected the form. My macro works. I just checked again,

and
it worked. So we are doing things differently.
Describe how you created the field (and gave it a name) where the user
enters the value and the document itself (how is it protected, what does

it
contain).

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
ISTOO
Word MVP site:
http://www.word.mvps.org