Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Chris Stammers Chris Stammers is offline
external usenet poster
 
Posts: 46
Default IF Statement Hierarchy - Word 2000

Hello,

Is there a hierarchy in an IF statement? I ask because I have a mailmerge
that is looking at certain criteria to generate a particular letter version
if that criteria is met, so it says { IF { MERGEFIELD field1 } = 2 "{ IF
{MERGEFIELD field2 } = 1 "LETTER" "" }" }

I should say, that within the merge, there are 2 variations of the above,
the other being { IF { MERGEFIELD field1 } = 2 "{ IF {MERGEFIELD field2 }
1 "LETTER2" "" }" }

There are then queries within the paragraphs of the letters to determine
what the paragraph should say and various formatting queries. It works - kind
of - but in the first version it also seems to be generating the letter where
the second field ISN'T '1', and dropping out part of one of the paragraphs.
It shouldn't be generating at all! HELP, it's driving me mad! (I hope this
all makes some sort of sense.......)

Thanks,
Chris


  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Chris Stammers Chris Stammers is offline
external usenet poster
 
Posts: 46
Default IF Statement Hierarchy - Word 2000

Hello,

Please ignore this last question; I have since sorted the problem out.
However, do things like Continuous Breaks and the position the query is
placed in the document have an effect on whether or not a merge will work? I
have a query I got from Peter and Graham to format currency to remove the
decimal point from a pence figure. This is on one document in several places
and works fine, but I have have it in another document where it is only used
once and the document generates with 'Field Calculation Error occurred in
record 1' etc.

Does anyone have any thoughts?

Thanks,
Chris

Thanks,
Chris


"Chris Stammers" wrote:

Hello,

Is there a hierarchy in an IF statement? I ask because I have a mailmerge
that is looking at certain criteria to generate a particular letter version
if that criteria is met, so it says { IF { MERGEFIELD field1 } = 2 "{ IF
{MERGEFIELD field2 } = 1 "LETTER" "" }" }

I should say, that within the merge, there are 2 variations of the above,
the other being { IF { MERGEFIELD field1 } = 2 "{ IF {MERGEFIELD field2 }
1 "LETTER2" "" }" }

There are then queries within the paragraphs of the letters to determine
what the paragraph should say and various formatting queries. It works - kind
of - but in the first version it also seems to be generating the letter where
the second field ISN'T '1', and dropping out part of one of the paragraphs.
It shouldn't be generating at all! HELP, it's driving me mad! (I hope this
all makes some sort of sense.......)

Thanks,
Chris


  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default IF Statement Hierarchy - Word 2000

At the moment I can't see anything wrong with either of the IF fields :-(
Personally I would always put the other result in (a "" before the final
"}" ) but I don't think it should make any difference).

But what exactly is in the field where you have put "LETTER" ? Is it
literallyt the word LETTER, a set of fields and text, an INCLUDETEXT, or
what (If you have used an INCLUDETEXT, then there could be a problem)

Peter Jamieson


"Chris Stammers" wrote in message
...
Hello,

Is there a hierarchy in an IF statement? I ask because I have a mailmerge
that is looking at certain criteria to generate a particular letter
version
if that criteria is met, so it says { IF { MERGEFIELD field1 } = 2 "{ IF
{MERGEFIELD field2 } = 1 "LETTER" "" }" }

I should say, that within the merge, there are 2 variations of the above,
the other being { IF { MERGEFIELD field1 } = 2 "{ IF {MERGEFIELD field2 }

1 "LETTER2" "" }" }

There are then queries within the paragraphs of the letters to determine
what the paragraph should say and various formatting queries. It works -
kind
of - but in the first version it also seems to be generating the letter
where
the second field ISN'T '1', and dropping out part of one of the
paragraphs.
It shouldn't be generating at all! HELP, it's driving me mad! (I hope this
all makes some sort of sense.......)

Thanks,
Chris



  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default IF Statement Hierarchy - Word 2000

In the case of { IF { MERGEFIELD field1 } = 2 "{ IF {MERGEFIELD field2 } = 1
"LETTER" "" }" }

field1 would be evaluated and if it equals 2, then Field 2 would be
evaluated. If it equals one, the word "LETTER" would be inserted. If
neither condition is met, nothing would be inserted.

Note, you do not need the quote marks around

{ IF {MERGEFIELD field2 } = 1 "LETTER" "" }

Are you sure that the fields always contain numeric values?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Chris Stammers" wrote in message
...
Hello,

Is there a hierarchy in an IF statement? I ask because I have a mailmerge
that is looking at certain criteria to generate a particular letter
version
if that criteria is met, so it says { IF { MERGEFIELD field1 } = 2 "{ IF
{MERGEFIELD field2 } = 1 "LETTER" "" }" }

I should say, that within the merge, there are 2 variations of the above,
the other being { IF { MERGEFIELD field1 } = 2 "{ IF {MERGEFIELD field2 }

1 "LETTER2" "" }" }

There are then queries within the paragraphs of the letters to determine
what the paragraph should say and various formatting queries. It works -
kind
of - but in the first version it also seems to be generating the letter
where
the second field ISN'T '1', and dropping out part of one of the
paragraphs.
It shouldn't be generating at all! HELP, it's driving me mad! (I hope this
all makes some sort of sense.......)

Thanks,
Chris




  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default IF Statement Hierarchy - Word 2000

However, do things like Continuous Breaks and the position the query is
placed in the document have an effect on whether or not a merge will work?


No, except
a. in the obvious sense that you want the results to be laid out how they
need to be laid out :-)
b. putting breaks in the middle of a field name (for example) is probably
not going to work.

once and the document generates with 'Field Calculation Error occurred in
record 1' etc.


Can you see the value of the number that seems to cause the problem?

Peter Jamieson

"Chris Stammers" wrote in message
...
Hello,

Please ignore this last question; I have since sorted the problem out.
However, do things like Continuous Breaks and the position the query is
placed in the document have an effect on whether or not a merge will work?
I
have a query I got from Peter and Graham to format currency to remove the
decimal point from a pence figure. This is on one document in several
places
and works fine, but I have have it in another document where it is only
used
once and the document generates with 'Field Calculation Error occurred in
record 1' etc.

Does anyone have any thoughts?

Thanks,
Chris

Thanks,
Chris


"Chris Stammers" wrote:

Hello,

Is there a hierarchy in an IF statement? I ask because I have a mailmerge
that is looking at certain criteria to generate a particular letter
version
if that criteria is met, so it says { IF { MERGEFIELD field1 } = 2 "{ IF
{MERGEFIELD field2 } = 1 "LETTER" "" }" }

I should say, that within the merge, there are 2 variations of the above,
the other being { IF { MERGEFIELD field1 } = 2 "{ IF {MERGEFIELD field2 }

1 "LETTER2" "" }" }

There are then queries within the paragraphs of the letters to determine
what the paragraph should say and various formatting queries. It works -
kind
of - but in the first version it also seems to be generating the letter
where
the second field ISN'T '1', and dropping out part of one of the
paragraphs.
It shouldn't be generating at all! HELP, it's driving me mad! (I hope
this
all makes some sort of sense.......)

Thanks,
Chris





  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Chris Stammers Chris Stammers is offline
external usenet poster
 
Posts: 46
Default IF Statement Hierarchy - Word 2000

It is a complete letter. I just put 'LETTER' for ease of explanation (!).
This is now working after a bit of playing about.

Thanks,
Chris

"Peter Jamieson" wrote:

At the moment I can't see anything wrong with either of the IF fields :-(
Personally I would always put the other result in (a "" before the final
"}" ) but I don't think it should make any difference).

But what exactly is in the field where you have put "LETTER" ? Is it
literallyt the word LETTER, a set of fields and text, an INCLUDETEXT, or
what (If you have used an INCLUDETEXT, then there could be a problem)

Peter Jamieson


"Chris Stammers" wrote in message
...
Hello,

Is there a hierarchy in an IF statement? I ask because I have a mailmerge
that is looking at certain criteria to generate a particular letter
version
if that criteria is met, so it says { IF { MERGEFIELD field1 } = 2 "{ IF
{MERGEFIELD field2 } = 1 "LETTER" "" }" }

I should say, that within the merge, there are 2 variations of the above,
the other being { IF { MERGEFIELD field1 } = 2 "{ IF {MERGEFIELD field2 }

1 "LETTER2" "" }" }

There are then queries within the paragraphs of the letters to determine
what the paragraph should say and various formatting queries. It works -
kind
of - but in the first version it also seems to be generating the letter
where
the second field ISN'T '1', and dropping out part of one of the
paragraphs.
It shouldn't be generating at all! HELP, it's driving me mad! (I hope this
all makes some sort of sense.......)

Thanks,
Chris



  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default IF Statement Hierarchy - Word 2000

BTW I would call \#"00p" a "query" - these things are normally called by
other jargon expressions, e.g. "numeric switch" or "numeric picture switch".

Peter Jamieson

"Chris Stammers" wrote in message
...
Hello,

Please ignore this last question; I have since sorted the problem out.
However, do things like Continuous Breaks and the position the query is
placed in the document have an effect on whether or not a merge will work?
I
have a query I got from Peter and Graham to format currency to remove the
decimal point from a pence figure. This is on one document in several
places
and works fine, but I have have it in another document where it is only
used
once and the document generates with 'Field Calculation Error occurred in
record 1' etc.

Does anyone have any thoughts?

Thanks,
Chris

Thanks,
Chris


"Chris Stammers" wrote:

Hello,

Is there a hierarchy in an IF statement? I ask because I have a mailmerge
that is looking at certain criteria to generate a particular letter
version
if that criteria is met, so it says { IF { MERGEFIELD field1 } = 2 "{ IF
{MERGEFIELD field2 } = 1 "LETTER" "" }" }

I should say, that within the merge, there are 2 variations of the above,
the other being { IF { MERGEFIELD field1 } = 2 "{ IF {MERGEFIELD field2 }

1 "LETTER2" "" }" }

There are then queries within the paragraphs of the letters to determine
what the paragraph should say and various formatting queries. It works -
kind
of - but in the first version it also seems to be generating the letter
where
the second field ISN'T '1', and dropping out part of one of the
paragraphs.
It shouldn't be generating at all! HELP, it's driving me mad! (I hope
this
all makes some sort of sense.......)

Thanks,
Chris



  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Chris Stammers Chris Stammers is offline
external usenet poster
 
Posts: 46
Default IF Statement Hierarchy - Word 2000

There is a mix of fields in the AS400 data source however what I was trying
to get to was IF MERGEFIELD field1 = 2 AND field2 = 1, then insert the
appropriate letter, otherwise don't do anything and move on to the next query
in the document which, if I understand correctly, is what you are saying.
After quite exhaustive testing, this is now working.

"Doug Robbins - Word MVP" wrote:

In the case of { IF { MERGEFIELD field1 } = 2 "{ IF {MERGEFIELD field2 } = 1
"LETTER" "" }" }

field1 would be evaluated and if it equals 2, then Field 2 would be
evaluated. If it equals one, the word "LETTER" would be inserted. If
neither condition is met, nothing would be inserted.

Note, you do not need the quote marks around

{ IF {MERGEFIELD field2 } = 1 "LETTER" "" }

Are you sure that the fields always contain numeric values?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Chris Stammers" wrote in message
...
Hello,

Is there a hierarchy in an IF statement? I ask because I have a mailmerge
that is looking at certain criteria to generate a particular letter
version
if that criteria is met, so it says { IF { MERGEFIELD field1 } = 2 "{ IF
{MERGEFIELD field2 } = 1 "LETTER" "" }" }

I should say, that within the merge, there are 2 variations of the above,
the other being { IF { MERGEFIELD field1 } = 2 "{ IF {MERGEFIELD field2 }

1 "LETTER2" "" }" }

There are then queries within the paragraphs of the letters to determine
what the paragraph should say and various formatting queries. It works -
kind
of - but in the first version it also seems to be generating the letter
where
the second field ISN'T '1', and dropping out part of one of the
paragraphs.
It shouldn't be generating at all! HELP, it's driving me mad! (I hope this
all makes some sort of sense.......)

Thanks,
Chris





Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
which statement right , question is Choose the correct statement? how many template?when we click new doc Microsoft Word Help 1 October 16th 06 11:15 AM
which statement right , question isChoose the correct statement? how many template?when we click new doc Microsoft Word Help 1 October 15th 06 11:20 PM
Word TOC converted to PDF bookmarks has incorrect hierarchy levels Dustdisk Microsoft Word Help 1 August 18th 06 04:38 AM
WORD insert reference drill in items hierarchy Bertrand Braschi Microsoft Word Help 0 April 7th 06 02:36 PM
File hierarchy representation in Word document Max Microsoft Word Help 5 August 11th 05 08:56 PM


All times are GMT +1. The time now is 12:25 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"