Trim Code

PaulJK

Registered User.
Local time
Today, 06:56
Joined
Jul 4, 2002
Messages
60
Hello,

I have some mailing lables which currently use the code:

=Trim([ClientTitle] & " " & [ClientSurname])

We now would like to add into this line a partners name, if there is one, which may have a different surname. There are additional fields: ClientPartnerTitle & ClientPartner Surname.

If for example we had Mr Briggs (ClientTitle & ClientSurname) and Miss Howes (ClientPartnerTitle & ClientPartner Surname) I would like to show on the mailing label 'Mr Briggs & Miss Howes'.

I could have:

=Trim([ClientTitle] & " " & [ClientSurname])& "&" & ([ClientPartnerTitle] & " " & [ClientPartnerSurname])

The problem I have is that if there areno partner details, I do not want an "&" appearing.

Your suggestions would be appreciated.

Thank you
 
=Trim([ClientTitle] & " " & [ClientSurname]) + ("&" & ([ClientPartnerTitle] & " " & [ClientPartnerSurname])) should work. If not

=Trim([ClientTitle] & " " & [ClientSurname]) + ("&" + ([ClientPartnerTitle] + " " + [ClientPartnerSurname])) should
 
Thanks for your reply.

The second piece of code works except when there is only a primary client name and no partner name. In these circumstances the primary client name is no shown at all. I apologise if I did not make this clear in my original posting. There may be a primary client name only or sometime a primary and partner name.

Any further suggestions would be appreciated.

Thanks
 
try
=Trim([ClientTitle] & " " & [ClientSurname]) & ("&" + ([ClientPartnerTitle] + " " + [ClientPartnerSurname]))
 

Users who are viewing this thread

Back
Top Bottom