Reply
 
Thread Tools Display Modes
  #1   Report Post  
pas926
 
Posts: n/a
Default Do not show data if zero Question

I have a mail merge that I added the IF Then statement to a field so that if
the value is zero, it doesn't show up on the document, however it does take
up a space that I have to remove from the document. I don't want that space,
is there a way to get rid of it.
Thanks any help is appreciated.
Paul
  #2   Report Post  
Peter Jamieson
 
Posts: n/a
Default

Are you absolutely sure that your IF field does not introduce any space?
E.g. if you have used

{ IF { MERGEFIELD myfield } = "0" " " "{ MERGEFIELD myfield }" }

then you will see a space, any you need to use

{ IF { MERGEFIELD myfield } = "0" "" "{ MERGEFIELD myfield }" }

Or maybe you mean that it uses an additional /line/ (i.e. paragrapgh) in
which case you can try putting the paragraph inside the IF results.

e.g. if you want

preceding text
number
follwing text

when there is a number and

preceding text
follwing text

when there is not, try

preceding text{ IF { MERGEFIELD myfield } = "0" " " "
{ MERGEFIELD myfield }" }
following text

Otherwise, can you post the exact contents of the IF field here please?

Peter Jamieson

"pas926" wrote in message
...
I have a mail merge that I added the IF Then statement to a field so that
if
the value is zero, it doesn't show up on the document, however it does
take
up a space that I have to remove from the document. I don't want that
space,
is there a way to get rid of it.
Thanks any help is appreciated.
Paul



  #3   Report Post  
Graham Mayor
 
Posts: n/a
Default

You can suppress zero with a field switch
http://www.gmayor.com/formatting_word_fields.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




pas926 wrote:
I have a mail merge that I added the IF Then statement to a field so
that if the value is zero, it doesn't show up on the document,
however it does take up a space that I have to remove from the
document. I don't want that space, is there a way to get rid of it.
Thanks any help is appreciated.
Paul



  #4   Report Post  
pas926
 
Posts: n/a
Default

Actually I want to get rid of the line that the code exists on if the result
is zero. When the merge is done and if code line LPI is zero it will take up
a line in the document that I have to erase. There are about 30 lines of
code. If I don't put the code on different lines then the formatting will be
off.
Here's some of my code:

{IF {Mergefield LPI}0 "Labwork Principal" {TypeLab 6/3} {LPI} "
"""}
{IF {Mergefield LSI}0 "Labwork Supervisor" {TypeLab 6/2} {LSI} "
"""}
{IF {Mergefield LAI}0 "Labwork Archaeologist" {TypeLab 6} {LAI} " """}

Thanks again in advance.
Paul


"Peter Jamieson" wrote:

Are you absolutely sure that your IF field does not introduce any space?
E.g. if you have used

{ IF { MERGEFIELD myfield } = "0" " " "{ MERGEFIELD myfield }" }

then you will see a space, any you need to use

{ IF { MERGEFIELD myfield } = "0" "" "{ MERGEFIELD myfield }" }

Or maybe you mean that it uses an additional /line/ (i.e. paragrapgh) in
which case you can try putting the paragraph inside the IF results.

e.g. if you want

preceding text
number
follwing text

when there is a number and

preceding text
follwing text

when there is not, try

preceding text{ IF { MERGEFIELD myfield } = "0" " " "
{ MERGEFIELD myfield }" }
following text

Otherwise, can you post the exact contents of the IF field here please?

Peter Jamieson

"pas926" wrote in message
...
I have a mail merge that I added the IF Then statement to a field so that
if
the value is zero, it doesn't show up on the document, however it does
take
up a space that I have to remove from the document. I don't want that
space,
is there a way to get rid of it.
Thanks any help is appreciated.
Paul




  #5   Report Post  
Peter Jamieson
 
Posts: n/a
Default

Can you use

{ IF { MERGEFIELD LPI } 0 "Labwork Principal {TypeLab 6/3} {LPI}
" "" }{ IF { MERGEFIELD LSI } 0 "Labwork Supervisor {TypeLab 6/2}
{LSI}
" "" }

etc., i.e. where the necessary paragraph mark is inserted as part of your
non-blank result?

Peter Jamieson

"pas926" wrote in message
...
Actually I want to get rid of the line that the code exists on if the
result
is zero. When the merge is done and if code line LPI is zero it will take
up
a line in the document that I have to erase. There are about 30 lines of
code. If I don't put the code on different lines then the formatting will
be
off.
Here's some of my code:

{IF {Mergefield LPI}0 "Labwork Principal" {TypeLab 6/3} {LPI}
"
"""}
{IF {Mergefield LSI}0 "Labwork Supervisor" {TypeLab 6/2} {LSI} "
"""}
{IF {Mergefield LAI}0 "Labwork Archaeologist" {TypeLab 6} {LAI} "
"""}

Thanks again in advance.
Paul


"Peter Jamieson" wrote:

Are you absolutely sure that your IF field does not introduce any space?
E.g. if you have used

{ IF { MERGEFIELD myfield } = "0" " " "{ MERGEFIELD myfield }" }

then you will see a space, any you need to use

{ IF { MERGEFIELD myfield } = "0" "" "{ MERGEFIELD myfield }" }

Or maybe you mean that it uses an additional /line/ (i.e. paragrapgh) in
which case you can try putting the paragraph inside the IF results.

e.g. if you want

preceding text
number
follwing text

when there is a number and

preceding text
follwing text

when there is not, try

preceding text{ IF { MERGEFIELD myfield } = "0" " " "
{ MERGEFIELD myfield }" }
following text

Otherwise, can you post the exact contents of the IF field here please?

Peter Jamieson

"pas926" wrote in message
...
I have a mail merge that I added the IF Then statement to a field so
that
if
the value is zero, it doesn't show up on the document, however it does
take
up a space that I have to remove from the document. I don't want that
space,
is there a way to get rid of it.
Thanks any help is appreciated.
Paul








  #6   Report Post  
pas926
 
Posts: n/a
Default

Thanks Peter,
Have tried that but it messes up my formatting more . Thanks for your
input, very much appreciated. Paul

"Peter Jamieson" wrote:

Can you use

{ IF { MERGEFIELD LPI } 0 "Labwork Principal {TypeLab 6/3} {LPI}
" "" }{ IF { MERGEFIELD LSI } 0 "Labwork Supervisor {TypeLab 6/2}
{LSI}
" "" }

etc., i.e. where the necessary paragraph mark is inserted as part of your
non-blank result?

Peter Jamieson

"pas926" wrote in message
...
Actually I want to get rid of the line that the code exists on if the
result
is zero. When the merge is done and if code line LPI is zero it will take
up
a line in the document that I have to erase. There are about 30 lines of
code. If I don't put the code on different lines then the formatting will
be
off.
Here's some of my code:

{IF {Mergefield LPI}0 "Labwork Principal" {TypeLab 6/3} {LPI}
"
"""}
{IF {Mergefield LSI}0 "Labwork Supervisor" {TypeLab 6/2} {LSI} "
"""}
{IF {Mergefield LAI}0 "Labwork Archaeologist" {TypeLab 6} {LAI} "
"""}

Thanks again in advance.
Paul


"Peter Jamieson" wrote:

Are you absolutely sure that your IF field does not introduce any space?
E.g. if you have used

{ IF { MERGEFIELD myfield } = "0" " " "{ MERGEFIELD myfield }" }

then you will see a space, any you need to use

{ IF { MERGEFIELD myfield } = "0" "" "{ MERGEFIELD myfield }" }

Or maybe you mean that it uses an additional /line/ (i.e. paragrapgh) in
which case you can try putting the paragraph inside the IF results.

e.g. if you want

preceding text
number
follwing text

when there is a number and

preceding text
follwing text

when there is not, try

preceding text{ IF { MERGEFIELD myfield } = "0" " " "
{ MERGEFIELD myfield }" }
following text

Otherwise, can you post the exact contents of the IF field here please?

Peter Jamieson

"pas926" wrote in message
...
I have a mail merge that I added the IF Then statement to a field so
that
if
the value is zero, it doesn't show up on the document, however it does
take
up a space that I have to remove from the document. I don't want that
space,
is there a way to get rid of it.
Thanks any help is appreciated.
Paul






  #7   Report Post  
Peter Jamieson
 
Posts: n/a
Default

OK, what goes wrong with the formatting when you do that? Is it to do with
horizontal layout (e.g. tabs), vertical layout (e.g. paragraph spacing) or
something else? If you define a paragraph style with the correct tabs etc.
and apply it to all the IF statements, does it make any difference.?

The only other reasonably simple way I can think of to solve this is to
create the data source you need, which may be possible if for example you
are using Access and are in a position to create your own queries, or if you
can issue the necessary SQL using Word VBA OpenDataSource. I'm not sure
exactly what might work in this case because tabs embedded in the SQL field
may not behave as you want, but for example you could try

SELECT lpi, iif(mytable.lpi = 0,'','Labwork Principal') AS `lpitext1` FROM
mytable

Then use

{ MERGEFIELD lpitext }{ IF { MERGEFIELD LPI } 0 " { TypeLab 6/3 }
{LPI}" "" }

in this case when LPI is 0 the IF statement should insert nothing, lpitext
should be blank, and so Word should suppress the line.

Peter Jamieson


"pas926" wrote in message
...
Thanks Peter,
Have tried that but it messes up my formatting more . Thanks for your
input, very much appreciated. Paul

"Peter Jamieson" wrote:

Can you use

{ IF { MERGEFIELD LPI } 0 "Labwork Principal {TypeLab 6/3} {LPI}
" "" }{ IF { MERGEFIELD LSI } 0 "Labwork Supervisor {TypeLab 6/2}
{LSI}
" "" }

etc., i.e. where the necessary paragraph mark is inserted as part of your
non-blank result?

Peter Jamieson

"pas926" wrote in message
...
Actually I want to get rid of the line that the code exists on if the
result
is zero. When the merge is done and if code line LPI is zero it will
take
up
a line in the document that I have to erase. There are about 30 lines
of
code. If I don't put the code on different lines then the formatting
will
be
off.
Here's some of my code:

{IF {Mergefield LPI}0 "Labwork Principal" {TypeLab 6/3}
{LPI}
"
"""}
{IF {Mergefield LSI}0 "Labwork Supervisor" {TypeLab 6/2}
{LSI} "
"""}
{IF {Mergefield LAI}0 "Labwork Archaeologist" {TypeLab 6} {LAI}
"
"""}

Thanks again in advance.
Paul


"Peter Jamieson" wrote:

Are you absolutely sure that your IF field does not introduce any
space?
E.g. if you have used

{ IF { MERGEFIELD myfield } = "0" " " "{ MERGEFIELD myfield }" }

then you will see a space, any you need to use

{ IF { MERGEFIELD myfield } = "0" "" "{ MERGEFIELD myfield }" }

Or maybe you mean that it uses an additional /line/ (i.e. paragrapgh)
in
which case you can try putting the paragraph inside the IF results.

e.g. if you want

preceding text
number
follwing text

when there is a number and

preceding text
follwing text

when there is not, try

preceding text{ IF { MERGEFIELD myfield } = "0" " " "
{ MERGEFIELD myfield }" }
following text

Otherwise, can you post the exact contents of the IF field here
please?

Peter Jamieson

"pas926" wrote in message
...
I have a mail merge that I added the IF Then statement to a field so
that
if
the value is zero, it doesn't show up on the document, however it
does
take
up a space that I have to remove from the document. I don't want
that
space,
is there a way to get rid of it.
Thanks any help is appreciated.
Paul








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
Specific Email Merge w/ Specific Attachements Mark B Mailmerge 9 February 21st 05 05:10 AM
Newbie question on MSWord templates and data [email protected] Microsoft Word Help 5 February 18th 05 05:57 PM
Data Mess Karen Microsoft Word Help 4 February 8th 05 12:53 AM
Word Field Codes in Excel data file mranz Mailmerge 7 December 11th 04 09:02 AM
Merge Data Source path Peter Jamieson Mailmerge 0 November 25th 04 07:15 PM


All times are GMT +1. The time now is 11:18 AM.

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"