Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
omsoft omsoft is offline
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
omsoft omsoft is offline
external usenet poster
 
Posts: 7
Default 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   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 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
omsoft omsoft is offline
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default 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   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 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
omsoft omsoft is offline
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
omsoft omsoft is offline
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
omsoft omsoft is offline
external usenet poster
 
Posts: 7
Default 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   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 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

Posting Rules

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add a condition in an includepicture with mergefield tinous Mailmerge 14 October 21st 06 09:33 AM
IF Condition Question Trudy Mailmerge 3 June 14th 06 02:45 PM
Multiple IF condition Susan Mailmerge 2 February 14th 06 07:26 AM
Multiple items per condition Mary Mailmerge 1 April 13th 05 08:29 AM
IF Condition for XML Tags Steve Microsoft Word Help 1 January 26th 05 09:36 AM


All times are GMT +1. The time now is 05:12 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"