Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mergefield suppress if data field blank | Mailmerge | |||
Suppress Blank Lines in Tables? | Tables | |||
suppress blank fields in template | Microsoft Word Help | |||
How do you suppress a line in word if merge fld is blank? | Mailmerge | |||
How to suppress blank lines at top of page | Page Layout |