Differentiating alphanumerics in an "IF" field

J

James Markham

I want to merge different statements from data in a field such as "5a" "5b"
and "5c" but the IF THEN function is treating them all as just a plain old
"5" and inserting all three of the relating comments. Any ideas how to get it
to treat tham as different pieces of data?
 
G

Graham Mayor

You cannot merge only part of a field in Word.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
J

James Markham

Thanks for the response, but I don't think that's what I'm trying to do. I
also don't think I phrased my question very well - I was trying to be brief,
but I guess that doesn't always help!
As an overview: I am trying to write school reports which generate a written
comment based on an existing piece of assessment data. Let me show an
example of what I'm trying to do:

{ IF {MERGEFILED Electronics Level} = “6c†"To use knowledge and
understanding of Printed Circuit Boards to design and develop an individual
timer circuit.†“â€}
{ IF {MERGEFILED Electronics Level} = “5a†“To follow instructions well to
produce a Printed Circuit Board and populate it with components to create a
timer circuit.†“â€}
{ IF {MERGEFILED Electronics Level} = “5b†“To produce a Printed Circuit
Board with assistance and populate it with components to create a timer
circuit.†“â€}

and so on.

In the past when the assessment data in the "Electronics Level" field was
just a number (i.e. "5" or "6" etc.) it worked like a dream. My problem is
that the data is now entered with three sub-levels as an alphanumeric (i.e.
"5a" "5b" "5c" "6a" "6b" "6c" etc.) and if a student has say a level "5b" the
mailmerge is inserting the comments for "5a" and "5c" too. Can I get it to
recognise that "5a" is not the same data as "5b"?

Did that make more sense?
 
M

macropod

Hi James,

Are *all* your field braces (ie '{}') created via Ctrl-F9? Also, you have a typo (MERGEFILED instead of MERGEFIELD). The following
should work:
{IF{MERGEFIELD Electronics Level}= "6c" "To use knowledge and understanding of Printed Circuit Boards to design and develop an
individual timer circuit."}
{IF{MERGEFIELD Electronics Level}= "5a" "To follow instructions well to produce a Printed Circuit Board and populate it with
components to create a timer circuit."}
{IF{MERGEFIELD Electronics Level}= "5b" "To produce a Printed Circuit Board with assistance and populate it with components to
create a timer circuit."}
etc.
 
P

Peter Jamieson

You need to quote the MERGEFIELD (and the field name if it has spaces), e.g.


{ IF "{ MERGEFIELD "Electronics Level" }" = “6c†"To use knowledge and
understanding of Printed Circuit Boards to design and develop an
individual timer circuit.†“â€}

I believe that in this particular case, because the mergefield value
starts with something that looks like a number, the comparison is
actually numeric, despite the quotes around the second comparand.

Peter Jamieson

http://tips.pjmsn.me.uk
 
J

James Markham

Many Thanks Peter. Simply putting quotes around "{ MERGEFIELD "Electronics
Level" }" made the whole thing work perfectly!
 

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