IF field code problem

P

Penggu

Hi All,

I'm trying to do this, which isn't working out as expected (formatted for
readability):

{
IF { AUTOTEXT AStudentYearLevel } = "0"
"Prep"
{ AUTOTEXT AStudentYearLevel }
}

{ AUTOTEXT AStudentYearLevel } by itself works, and prints a number between
0 and 10, 0 = Prep, 1 = Grade 1, etc. I just need to get rid of the 0, as
"Grade 0" doesn't exactly sound right.

I hope I make sense.
Thanks.
 
D

Doug Robbins

Try

{ IF { ={ AUTOTEXT AStudentYearLevel } + 0 } = 0 "Prep" { AUTOTEXT
AStudentYearLevel } }


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
G

Graham Mayor

Plan B

{Autotext AStudentYearLevel \# "#;;"}

should get rid of the 0 but display any other number

However

{ IF{Autotext AStudentYearLevel} <> 0 "{Autotext AStudentYearLevel}" "Prep"}

works here.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
P

Penggu

The major problem with all this, is that I didn't know you had to double
insert the field braces specially, rather than tying them in.

I'd used insert for the IF, but not for the AUTOTEXT. It's all working now,
thank God.

Thank you all.
 
G

Graham Mayor

You can enter the field braces with CTRL+F9

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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