Last Header
=Left$(txtLast),1)
Detail
=[LAST]&","&[FIRST]&" & "&[SPOUSE]
Prints Out:
With Spouse populated
Langseth, James & Mary
With Spouse Field blank
Langseth, James &
I would like not for & to print
I also would like the spouse to go to the second line if it is too long
Langseth, James
& Mary
:
On Tue, 3 Jan 2006 14:53:02 -0800, James Langseth wrote:
I'm writing a report that has Last name, first name & spouse. I have wrtten
an expression that does not send the spouses name to the second line id its
too long and it prints the "&" even if there is no spouse.
Why don't you post your expression, and what you want the result to
look like, both with the Spouse name and without it?
Here is one way:
=[LAST] & "," & [FIRST] & IIf(IsNull([Spouse]),"", " & " & [SPOUSE])
Here is another way:
=[LAST] & "," & [FIRST] & (" & " + [SPOUSE])
If you want the Spouse's name to appear on the next line only if the
text is too long, set the control's CanGrow property to Yes.
Also set the Detail Section CanGrow to Yes (unless you are doing this
as mailing labels).
If you ALWAYS want the Spouse's name to appear on the next line, then:
=[LAST] & "," & [FIRST] & IIf(IsNull([Spouse]),"", chr(13) & chr(10) &
"& " & [SPOUSE])
or..
=[LAST] & "," & [FIRST] & (chr(13) & chr(10) & "& " + [SPOUSE])