Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
John B John B is offline
external usenet poster
 
Posts: 7
Default Suppress Blank Data

I am putting together a mail merge from access consisting of names and
address'. Included in the name is middle name. The field name for middle name
is mname. I would like to suppress the mname field every time that there is
no data in that field. I know how to suppress blank data in access, but do
not know how in word. I tried the same format from access, but it did not
work. The reason I am doing this through word, instead of access, is that I
have to rotate the font 90 degrees to go on the label.
Thanks.

John
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Suppress Blank Data

The problem isn't usually suppressing the field, but ensuring that the blank
space you need when the field has something in it is not there when the
field is empty.

e.g. suppose you have

{ MERGEFIELD firstname } { MERGEFIELD middlename } { MERGEFIELD lastname }

If firstname is Peter and lastname is Jamieson, but middlename is blank, you
will get

Peter Jamieson

(i.e. with two spaces between the names).

To suppress that you can for example
a. use the \b switch in the MERGEFIELD field in Word 2002 and later to
insert the necessary spaces, e.g.

{ MERGEFIELD firstname }{ MERGEFIELD middlename \b " " }{ MERGEFIELD
lastname \b " " }

b. use nested IF fields, e.g.

{ MERGEFIELD firstname
}{ IF "{ MERGEFIELD middlename }" = "" "" " { MERGEFIELD middlename }"
}{ IF "{ MERGEFIELD lastname }" = "" "" " { MERGEFIELD lastname }" }

c. create an Access query that returns exactly the string you want,
typically using iif functions to insert additional space when the related
field is non-blank, then use that as the data source for the merge. If you
are more familiar with the Access query language than the Word field
language, there's a lot to be said for constructing the entire address that
way.

NB, all the {} need to be the special field codes you can insert using
ctrl-F9, not the ordinary keyboard characters.

Peter Jamieson
"John B" wrote in message
...
I am putting together a mail merge from access consisting of names and
address'. Included in the name is middle name. The field name for middle
name
is mname. I would like to suppress the mname field every time that there
is
no data in that field. I know how to suppress blank data in access, but do
not know how in word. I tried the same format from access, but it did not
work. The reason I am doing this through word, instead of access, is that
I
have to rotate the font 90 degrees to go on the label.
Thanks.

John



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
John B John B is offline
external usenet poster
 
Posts: 7
Default Suppress Blank Data

Peter,

Thanks for this info. It worked like a charm. I have done plenty of
query's in access, but I never gave it a thought about doing this there. Your
information will be useful doing other mail merges from excel and other types
of txt or csv's. Thanks again.

John


"Peter Jamieson" wrote:

The problem isn't usually suppressing the field, but ensuring that the blank
space you need when the field has something in it is not there when the
field is empty.

e.g. suppose you have

{ MERGEFIELD firstname } { MERGEFIELD middlename } { MERGEFIELD lastname }

If firstname is Peter and lastname is Jamieson, but middlename is blank, you
will get

Peter Jamieson

(i.e. with two spaces between the names).

To suppress that you can for example
a. use the \b switch in the MERGEFIELD field in Word 2002 and later to
insert the necessary spaces, e.g.

{ MERGEFIELD firstname }{ MERGEFIELD middlename \b " " }{ MERGEFIELD
lastname \b " " }

b. use nested IF fields, e.g.

{ MERGEFIELD firstname
}{ IF "{ MERGEFIELD middlename }" = "" "" " { MERGEFIELD middlename }"
}{ IF "{ MERGEFIELD lastname }" = "" "" " { MERGEFIELD lastname }" }

c. create an Access query that returns exactly the string you want,
typically using iif functions to insert additional space when the related
field is non-blank, then use that as the data source for the merge. If you
are more familiar with the Access query language than the Word field
language, there's a lot to be said for constructing the entire address that
way.

NB, all the {} need to be the special field codes you can insert using
ctrl-F9, not the ordinary keyboard characters.

Peter Jamieson
"John B" wrote in message
...
I am putting together a mail merge from access consisting of names and
address'. Included in the name is middle name. The field name for middle
name
is mname. I would like to suppress the mname field every time that there
is
no data in that field. I know how to suppress blank data in access, but do
not know how in word. I tried the same format from access, but it did not
work. The reason I am doing this through word, instead of access, is that
I
have to rotate the font 90 degrees to go on the label.
Thanks.

John




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
Mergefield suppress if data field blank JB reluctantly from WP Mailmerge 13 February 24th 09 02:36 AM
Suppress Blank Lines in Tables? JohnJohn Tables 4 June 18th 06 11:20 PM
suppress blank fields in template Alicia Microsoft Word Help 1 June 1st 06 08:59 PM
How do you suppress a line in word if merge fld is blank? Todd Mailmerge 6 July 21st 05 06:22 AM
How to suppress blank lines at top of page Geoff Page Layout 1 December 14th 04 10:11 PM


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