Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELD on Condition
I have a table in mail merge which is being populated by an Access table.
It has tree columns - product, region, revenue and five rows. I want to create a mergefield where if revenue = 0 then leave product and region blank. I have added the field as below. But it does not work. Can someone please tell me what I am doing wrong? Thanks much. {IF{MERGEFIELD rev = 0 """" {MERGEFIELD prod}}} |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELD on Condition
Something more like...
{ IF { MERGEFIELD revenue } = 0 "" "{ MERGEFIELD prod }" } All the {} have to be the special field code brace pairs that you can insert using ctrl-F9 Peter Jamieson http://tips.pjmsn.me.uk omsoft wrote: I have a table in mail merge which is being populated by an Access table. It has tree columns - product, region, revenue and five rows. I want to create a mergefield where if revenue = 0 then leave product and region blank. I have added the field as below. But it does not work. Can someone please tell me what I am doing wrong? Thanks much. {IF{MERGEFIELD rev = 0 """" {MERGEFIELD prod}}} |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELD on Condition
Thanks Peter, I did exactly as you mentioned, but I could not really make it work. May be because my column order is product, region and revenue and so when I am populating product, revenue is still not populated? Does the order matter when evaluating condition? "Peter Jamieson" wrote: Something more like... { IF { MERGEFIELD revenue } = 0 "" "{ MERGEFIELD prod }" } All the {} have to be the special field code brace pairs that you can insert using ctrl-F9 Peter Jamieson http://tips.pjmsn.me.uk omsoft wrote: I have a table in mail merge which is being populated by an Access table. It has tree columns - product, region, revenue and five rows. I want to create a mergefield where if revenue = 0 then leave product and region blank. I have added the field as below. But it does not work. Can someone please tell me what I am doing wrong? Thanks much. {IF{MERGEFIELD rev = 0 """" {MERGEFIELD prod}}} |
#4
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELD on Condition
Do you have a { MERGEFIELD revenue } field in the document where you want
the revenue to appear (That is one outside of the If...then...Else field construction, which only controls the insertion of the product. You need a similar If...then...Else field construction for the region where you want that to appear if the revenue is not zero. -- 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 "omsoft" wrote in message ... Thanks Peter, I did exactly as you mentioned, but I could not really make it work. May be because my column order is product, region and revenue and so when I am populating product, revenue is still not populated? Does the order matter when evaluating condition? "Peter Jamieson" wrote: Something more like... { IF { MERGEFIELD revenue } = 0 "" "{ MERGEFIELD prod }" } All the {} have to be the special field code brace pairs that you can insert using ctrl-F9 Peter Jamieson http://tips.pjmsn.me.uk omsoft wrote: I have a table in mail merge which is being populated by an Access table. It has tree columns - product, region, revenue and five rows. I want to create a mergefield where if revenue = 0 then leave product and region blank. I have added the field as below. But it does not work. Can someone please tell me what I am doing wrong? Thanks much. {IF{MERGEFIELD rev = 0 """" {MERGEFIELD prod}}} |
#5
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELD on Condition
Thanks Doug, I do have a mergefield rev outside the table.
The letter is name, address, etc. at the top followed by a three column table where the columns are product, region and revenue in that order. I do not know how many rows of data this table will have but I limit it at 5 and create a new form if 5. So the product one is as below: {if {mergefield rev} 0 {mergefield prod} ""} The region also would be similar except that it would specify regn instead of prod. And the revenue one just says {mergefield rev}. IN the table prior to that, I am forcibly setting revenue to 0 if it is null to avoid complications of checking null or empty string. Thanks. "Doug Robbins - Word MVP" wrote: Do you have a { MERGEFIELD revenue } field in the document where you want the revenue to appear (That is one outside of the If...then...Else field construction, which only controls the insertion of the product. You need a similar If...then...Else field construction for the region where you want that to appear if the revenue is not zero. -- 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 "omsoft" wrote in message ... Thanks Peter, I did exactly as you mentioned, but I could not really make it work. May be because my column order is product, region and revenue and so when I am populating product, revenue is still not populated? Does the order matter when evaluating condition? "Peter Jamieson" wrote: Something more like... { IF { MERGEFIELD revenue } = 0 "" "{ MERGEFIELD prod }" } All the {} have to be the special field code brace pairs that you can insert using ctrl-F9 Peter Jamieson http://tips.pjmsn.me.uk omsoft wrote: I have a table in mail merge which is being populated by an Access table. It has tree columns - product, region, revenue and five rows. I want to create a mergefield where if revenue = 0 then leave product and region blank. I have added the field as below. But it does not work. Can someone please tell me what I am doing wrong? Thanks much. {IF{MERGEFIELD rev = 0 """" {MERGEFIELD prod}}} |
#6
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELD on Condition
If you insert
{ MERGEFIELD revenue } on its own what values can you get? Peter Jamieson http://tips.pjmsn.me.uk omsoft wrote: Thanks Peter, I did exactly as you mentioned, but I could not really make it work. May be because my column order is product, region and revenue and so when I am populating product, revenue is still not populated? Does the order matter when evaluating condition? "Peter Jamieson" wrote: Something more like... { IF { MERGEFIELD revenue } = 0 "" "{ MERGEFIELD prod }" } All the {} have to be the special field code brace pairs that you can insert using ctrl-F9 Peter Jamieson http://tips.pjmsn.me.uk omsoft wrote: I have a table in mail merge which is being populated by an Access table. It has tree columns - product, region, revenue and five rows. I want to create a mergefield where if revenue = 0 then leave product and region blank. I have added the field as below. But it does not work. Can someone please tell me what I am doing wrong? Thanks much. {IF{MERGEFIELD rev = 0 """" {MERGEFIELD prod}}} |
#7
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELD on Condition
It sounds like you may need to take a look at:
http://cornell.veplan.net/article.aspx?&a=3815 or fellow MVP, macropod's tutorial on Catalogue/Directory Mailmerges at: http://www.wopr.com/cgi-bin/w3t/show...?Number=731107 -- 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 "omsoft" wrote in message ... Thanks Doug, I do have a mergefield rev outside the table. The letter is name, address, etc. at the top followed by a three column table where the columns are product, region and revenue in that order. I do not know how many rows of data this table will have but I limit it at 5 and create a new form if 5. So the product one is as below: {if {mergefield rev} 0 {mergefield prod} ""} The region also would be similar except that it would specify regn instead of prod. And the revenue one just says {mergefield rev}. IN the table prior to that, I am forcibly setting revenue to 0 if it is null to avoid complications of checking null or empty string. Thanks. "Doug Robbins - Word MVP" wrote: Do you have a { MERGEFIELD revenue } field in the document where you want the revenue to appear (That is one outside of the If...then...Else field construction, which only controls the insertion of the product. You need a similar If...then...Else field construction for the region where you want that to appear if the revenue is not zero. -- 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 "omsoft" wrote in message ... Thanks Peter, I did exactly as you mentioned, but I could not really make it work. May be because my column order is product, region and revenue and so when I am populating product, revenue is still not populated? Does the order matter when evaluating condition? "Peter Jamieson" wrote: Something more like... { IF { MERGEFIELD revenue } = 0 "" "{ MERGEFIELD prod }" } All the {} have to be the special field code brace pairs that you can insert using ctrl-F9 Peter Jamieson http://tips.pjmsn.me.uk omsoft wrote: I have a table in mail merge which is being populated by an Access table. It has tree columns - product, region, revenue and five rows. I want to create a mergefield where if revenue = 0 then leave product and region blank. I have added the field as below. But it does not work. Can someone please tell me what I am doing wrong? Thanks much. {IF{MERGEFIELD rev = 0 """" {MERGEFIELD prod}}} |
#8
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELD on Condition
Thanks Peter. I am getting all correcting values, that is not a problem.
Sorry if I did not clarify. I want to add this condition, so if revenue is 0, the product and region fields become blank. When I add a field, { MERGEFIELD revenue }, I get revenue amount, and in those blank rows I get nothing (empty string). "Peter Jamieson" wrote: If you insert { MERGEFIELD revenue } on its own what values can you get? Peter Jamieson http://tips.pjmsn.me.uk omsoft wrote: Thanks Peter, I did exactly as you mentioned, but I could not really make it work. May be because my column order is product, region and revenue and so when I am populating product, revenue is still not populated? Does the order matter when evaluating condition? "Peter Jamieson" wrote: Something more like... { IF { MERGEFIELD revenue } = 0 "" "{ MERGEFIELD prod }" } All the {} have to be the special field code brace pairs that you can insert using ctrl-F9 Peter Jamieson http://tips.pjmsn.me.uk omsoft wrote: I have a table in mail merge which is being populated by an Access table. It has tree columns - product, region, revenue and five rows. I want to create a mergefield where if revenue = 0 then leave product and region blank. I have added the field as below. But it does not work. Can someone please tell me what I am doing wrong? Thanks much. {IF{MERGEFIELD rev = 0 """" {MERGEFIELD prod}}} |
#9
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELD on Condition
Thanks Doug for the links. I had seen these earlier but this may be too complex for the users to deal with later on (once I have done my task and gone away at contract-end). The source data table in Access is set up so that each row includes customer name, address, etc. and then five sets of product, region and revenue. And I create one letter for each row of data. So a customer with more than five rows of data will get more than one letter. "Doug Robbins - Word MVP" wrote: It sounds like you may need to take a look at: http://cornell.veplan.net/article.aspx?&a=3815 or fellow MVP, macropod's tutorial on Catalogue/Directory Mailmerges at: http://www.wopr.com/cgi-bin/w3t/show...?Number=731107 -- 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 "omsoft" wrote in message ... Thanks Doug, I do have a mergefield rev outside the table. The letter is name, address, etc. at the top followed by a three column table where the columns are product, region and revenue in that order. I do not know how many rows of data this table will have but I limit it at 5 and create a new form if 5. So the product one is as below: {if {mergefield rev} 0 {mergefield prod} ""} The region also would be similar except that it would specify regn instead of prod. And the revenue one just says {mergefield rev}. IN the table prior to that, I am forcibly setting revenue to 0 if it is null to avoid complications of checking null or empty string. Thanks. "Doug Robbins - Word MVP" wrote: Do you have a { MERGEFIELD revenue } field in the document where you want the revenue to appear (That is one outside of the If...then...Else field construction, which only controls the insertion of the product. You need a similar If...then...Else field construction for the region where you want that to appear if the revenue is not zero. -- 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 "omsoft" wrote in message ... Thanks Peter, I did exactly as you mentioned, but I could not really make it work. May be because my column order is product, region and revenue and so when I am populating product, revenue is still not populated? Does the order matter when evaluating condition? "Peter Jamieson" wrote: Something more like... { IF { MERGEFIELD revenue } = 0 "" "{ MERGEFIELD prod }" } All the {} have to be the special field code brace pairs that you can insert using ctrl-F9 Peter Jamieson http://tips.pjmsn.me.uk omsoft wrote: I have a table in mail merge which is being populated by an Access table. It has tree columns - product, region, revenue and five rows. I want to create a mergefield where if revenue = 0 then leave product and region blank. I have added the field as below. But it does not work. Can someone please tell me what I am doing wrong? Thanks much. {IF{MERGEFIELD rev = 0 """" {MERGEFIELD prod}}} |
#10
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELD on Condition
In that case you probably need: { IF { MERGEFIELD revenue } = "" "" "{ MERGEFIELD prod }" } or possibly even { IF "{ MERGEFIELD revenue }" = "" "" "{ MERGEFIELD prod }" } Peter Jamieson http://tips.pjmsn.me.uk omsoft wrote: Thanks Peter. I am getting all correcting values, that is not a problem. Sorry if I did not clarify. I want to add this condition, so if revenue is 0, the product and region fields become blank. When I add a field, { MERGEFIELD revenue }, I get revenue amount, and in those blank rows I get nothing (empty string). "Peter Jamieson" wrote: If you insert { MERGEFIELD revenue } on its own what values can you get? Peter Jamieson http://tips.pjmsn.me.uk omsoft wrote: Thanks Peter, I did exactly as you mentioned, but I could not really make it work. May be because my column order is product, region and revenue and so when I am populating product, revenue is still not populated? Does the order matter when evaluating condition? "Peter Jamieson" wrote: Something more like... { IF { MERGEFIELD revenue } = 0 "" "{ MERGEFIELD prod }" } All the {} have to be the special field code brace pairs that you can insert using ctrl-F9 Peter Jamieson http://tips.pjmsn.me.uk omsoft wrote: I have a table in mail merge which is being populated by an Access table. It has tree columns - product, region, revenue and five rows. I want to create a mergefield where if revenue = 0 then leave product and region blank. I have added the field as below. But it does not work. Can someone please tell me what I am doing wrong? Thanks much. {IF{MERGEFIELD rev = 0 """" {MERGEFIELD prod}}} |
#11
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELD on Condition
Thanks Peter, that works.Thanks a million.
I should have been checking for empty string rather than 0. "Peter Jamieson" wrote: In that case you probably need: { IF { MERGEFIELD revenue } = "" "" "{ MERGEFIELD prod }" } or possibly even { IF "{ MERGEFIELD revenue }" = "" "" "{ MERGEFIELD prod }" } Peter Jamieson http://tips.pjmsn.me.uk omsoft wrote: Thanks Peter. I am getting all correcting values, that is not a problem. Sorry if I did not clarify. I want to add this condition, so if revenue is 0, the product and region fields become blank. When I add a field, { MERGEFIELD revenue }, I get revenue amount, and in those blank rows I get nothing (empty string). "Peter Jamieson" wrote: If you insert { MERGEFIELD revenue } on its own what values can you get? Peter Jamieson http://tips.pjmsn.me.uk omsoft wrote: Thanks Peter, I did exactly as you mentioned, but I could not really make it work. May be because my column order is product, region and revenue and so when I am populating product, revenue is still not populated? Does the order matter when evaluating condition? "Peter Jamieson" wrote: Something more like... { IF { MERGEFIELD revenue } = 0 "" "{ MERGEFIELD prod }" } All the {} have to be the special field code brace pairs that you can insert using ctrl-F9 Peter Jamieson http://tips.pjmsn.me.uk omsoft wrote: I have a table in mail merge which is being populated by an Access table. It has tree columns - product, region, revenue and five rows. I want to create a mergefield where if revenue = 0 then leave product and region blank. I have added the field as below. But it does not work. Can someone please tell me what I am doing wrong? Thanks much. {IF{MERGEFIELD rev = 0 """" {MERGEFIELD prod}}} |
#12
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MERGEFIELD on Condition
That is not the way that the database should be set up.
-- 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 "omsoft" wrote in message ... Thanks Doug for the links. I had seen these earlier but this may be too complex for the users to deal with later on (once I have done my task and gone away at contract-end). The source data table in Access is set up so that each row includes customer name, address, etc. and then five sets of product, region and revenue. And I create one letter for each row of data. So a customer with more than five rows of data will get more than one letter. "Doug Robbins - Word MVP" wrote: It sounds like you may need to take a look at: http://cornell.veplan.net/article.aspx?&a=3815 or fellow MVP, macropod's tutorial on Catalogue/Directory Mailmerges at: http://www.wopr.com/cgi-bin/w3t/show...?Number=731107 -- 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 "omsoft" wrote in message ... Thanks Doug, I do have a mergefield rev outside the table. The letter is name, address, etc. at the top followed by a three column table where the columns are product, region and revenue in that order. I do not know how many rows of data this table will have but I limit it at 5 and create a new form if 5. So the product one is as below: {if {mergefield rev} 0 {mergefield prod} ""} The region also would be similar except that it would specify regn instead of prod. And the revenue one just says {mergefield rev}. IN the table prior to that, I am forcibly setting revenue to 0 if it is null to avoid complications of checking null or empty string. Thanks. "Doug Robbins - Word MVP" wrote: Do you have a { MERGEFIELD revenue } field in the document where you want the revenue to appear (That is one outside of the If...then...Else field construction, which only controls the insertion of the product. You need a similar If...then...Else field construction for the region where you want that to appear if the revenue is not zero. -- 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 "omsoft" wrote in message ... Thanks Peter, I did exactly as you mentioned, but I could not really make it work. May be because my column order is product, region and revenue and so when I am populating product, revenue is still not populated? Does the order matter when evaluating condition? "Peter Jamieson" wrote: Something more like... { IF { MERGEFIELD revenue } = 0 "" "{ MERGEFIELD prod }" } All the {} have to be the special field code brace pairs that you can insert using ctrl-F9 Peter Jamieson http://tips.pjmsn.me.uk omsoft wrote: I have a table in mail merge which is being populated by an Access table. It has tree columns - product, region, revenue and five rows. I want to create a mergefield where if revenue = 0 then leave product and region blank. I have added the field as below. But it does not work. Can someone please tell me what I am doing wrong? Thanks much. {IF{MERGEFIELD rev = 0 """" {MERGEFIELD prod}}} |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to add a condition in an includepicture with mergefield | Mailmerge | |||
IF Condition Question | Mailmerge | |||
Multiple IF condition | Mailmerge | |||
Multiple items per condition | Mailmerge | |||
IF Condition for XML Tags | Microsoft Word Help |