Mergefield statement help

J

John

Result I want whether employee has an entry in "aka" field or not.
«EmployeeFirst» L. «EmployeeLast» aka Larry Alan Young v. «Employer»

{MERGEFIELD EmployeeFirst} {IF {MERGEFIELD EE_MI} <>"" "{MERGEFIELD EE_MI }
"}{MERGEFIELD EmployeeLast} {IF {MERGEFIELD AKA} <>"" "{MERGEFIELD AKA}"}v.
{MERGEFIELD Employer}

Merged Result using above:

Name with aka in field: Alan L. Young aka Larry Alan Youngv. (this result
needs space between g and v.)
Name with blank aka field: Martin Begg v. (this result has correct spacing)

If I instead add a space in front of the v. in above mergefield statement, I
get the following result:

Name with aka in field: Alan L. Young aka Larry Alan Young v. (this
spacing is correct between g and v.)
Name with blank aka field: Martin Begg v. (this result has added an
additional space and is incorrect)


Same Mergefield statement but in sentence format:

The employee «EmployeeFirst» «EmployeeLast». The next sentence starts.

The employee {MERGEFIELD EmployeeFirst} {IF {MERGEFIELD EE_MI} <>""
"{MERGEFIELD EE_MI } "}{MERGEFIELD EmployeeLast} {IF {MERGEFIELD AKA} <>""
"{MERGEFIELD AKA}"}. The next sentance starts


Merge Result:

Name with aka in field: Alan L. Youngaka Larry Alan Young. (needs space
between g and aka, but the spacing at end with period is correct)

Name with blank aka field: Martin Begg. (has correct spacing at period)

Can someone tell me where my mergefield statement is incorrect so that I can
use in all instances shown above.

Thank you,
AJ
 
J

John

I forgot to add that I am working with Word 2000 (form files) and Excel 2000
(database) merging the two.

OS is XP Pro

Thank you,
AJ for John R.
 
D

Doug Robbins - Word MVP

{MERGEFIELD EmployeeFirst} {IF {MERGEFIELD EE_MI} <>"" "{MERGEFIELD EE_MI }
"}{MERGEFIELD EmployeeLast} {IF {MERGEFIELD AKA} <>"" "{MERGEFIELD AKA} v."
"v."}
{MERGEFIELD Employer}


--
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
 
J

John

I tried your suggestion.
It works well for those entries that an "aka" exists for. Unfortunately for
those entries where the "aka" field is blank the v. does not print.

Thanks for your help.

AJ
 
D

Doug Robbins - Word MVP

There must be something wrong with the way that you have entered the field.

{IF {MERGEFIELD AKA} <>"" "{MERGEFIELD AKA} v." "v."}

If AKA is empty, that is <>"" is false, then the above construction will
return v.

Maybe the fields need updating to display the result.


--
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
 
J

John

Thank you for your suggestions. I appreciate that it should work. I have
had several persons in my office check the entry of the statement and it is
official that I have typed the statement as should be regarding your example
below.

Regarding updating the field.....I used both select all and file save as
well as select all and F9. Using the F9 to update has worked in the past for
any changes I have made to these forms.

As far as the entry of the field itself, I am using the Insert Merge Field
button in my document and choosing the AKA field.

Something is still not working properly. With an aka the result/print is
correct. Without an aka just a space prints between the employee last name
and the employer name. No v. prints at all for an employee with a blank aka
field.

In the Tools Options I have the "Update Automatic Links at Open" under
General Tab checked.

Is there something else I am missing?

Thank you,
AJ
 
J

John

Thank you. I found my error. I had copied a previous IF section and just
inserted the aka field. I decided to start all from scratch using the Insert
Field then Mailmerge category and completed the statement you offered.

It works just as you have indicated.
Sorry to irritate you over this.

Very much appreciate all your help and comments.

AJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top