Nesting IF's

J

John Sutton

I was trying to nest some IF Then Else's, and was not successful. I
tried replacing the second set of result '""' with another inserted IF
Then Else, but it didn't work.

Can you do this???

Thanks
John
KBS
 
P

Peter Jamieson

You can nest IFs but personally I wouldn't attempt to do it with the
facility provided by Word for IF insertion. Use Alt-F9 to show the field
codes, ctrl-F9 to insert the special field code braces, then type the rest.
e.g. if you already have

{ IF {MERGEFIELD x } = 0 "" "" }

and you want an IF inside the "true" result, position the insertion point
between the first "" and press ctrl-F9 to give you

{ IF {MERGEFIELD x } = 0 "{ }" "" }

Then, assming you want to test the value of another MERGEFIELD, type IF ,
then ctrl-F9

{ IF {MERGEFIELD x } = 0 "{ IF { } }" "" }

Then type all the remaining texts

{ IF {MERGEFIELD x } = 0 "{ IF { MERGEFIELD y } = 0 "x=0,y=0" "x=0,y<>0" }"
"x<>0" }
 

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