Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
which statement right , question is Choose the correct statement? | Microsoft Word Help | |||
which statement right , question isChoose the correct statement? | Microsoft Word Help | |||
Word TOC converted to PDF bookmarks has incorrect hierarchy levels | Microsoft Word Help | |||
WORD insert reference drill in items hierarchy | Microsoft Word Help | |||
File hierarchy representation in Word document | Microsoft Word Help |