Mailing Label Problem (1 Viewer)

T

trumanst

Guest
I need to insert conditional text into my mailing labels. I have two fields [Husband] and [Wife] but if they are both filled in I need to insert an "&" in between the fields for the mailing labels. I only need to insert the "&" if they are both filled in though, not in the case of a single entry.

=Trim([Prefix] & " " & [Husband] & " " & [Wife] & " " & [LastName])

A little help would be greatly appreciated.
 

KevinM

Registered User.
Local time
Today, 07:35
Joined
Jun 15, 2000
Messages
719
Put an unbound text box on your report (called MyText for this example.

On the onFormat Event of tghe detail put....

If isNull([Husband]) Then
MyText=[Prefix] & " " & [Wife]& " " & [LastName]
Else
If isNull([Wife]) Then
MyText=[Prefix] & " " & [Husband] & " " & [LastName]
Else
MyText=[Prefix] & " " & [Husband] & " " & [Wife] & " " & [LastName]
End If
End If
End If

HTH
 

Rich@ITTC

Registered User.
Local time
Today, 07:35
Joined
Jul 13, 2000
Messages
237
Hi Trumanst and KevinM

Just a little adjustment to the coding KevinM has provided. I think when both Husband and Wife details are available Trumanst wants "Mr John & Jane Smith" so there needs to be another ampersand.

...
Else
MyText=[Prefix] & " " & [Husband] & " & " & [Wife] & " " & [LastName]
End If
End If
End If

HTH

Rich Gorvin

[This message has been edited by Rich@ITTC (edited 03-27-2001).]
 

KevinM

Registered User.
Local time
Today, 07:35
Joined
Jun 15, 2000
Messages
719
Thanks Rich (again!)

Too many ampersands confused me !
 

Users who are viewing this thread

Top Bottom