I am going crazy with this text box. I want it to insert a CR/LF only when
the line has text, but it does it every time. Why? I need help!
=[DonName] & Chr(13) & Chr(10) &
IIf(IsNull([DonAddr1]),"",[DonAddr1] & Chr(13) & Chr(10)) &
IIf(IsNull([DonAddr2]),"",[DonAddr2] & Chr(13) & Chr(10)) &
IIf(IsNull([DonAddr3]),"",[DonAddr3] & Chr(13) & Chr(10)) &
IIf(IsNull([DonAddr4]),"",[DonAddr4] & Chr(13) & Chr(10)) &
IIf(IsNull([DonAddr5]),"",[DonAddr5] & Chr(13) & Chr(10)) &
IIf(IsNull([DonAddr6]),"",[DonAddr6] & Chr(13) & Chr(10)) &
"Dear " & [DonSalPres] & ":"

Signature
David Habercom
University of Tennessee
David Habercom - 20 Oct 2005 20:09 GMT
I found the answer: a new update method I am using inserts a space on every
empty address line. The blank lines are not really null. THAT I can fix.
Thanks.

Signature
David Habercom
University of Tennessee
> I am going crazy with this text box. I want it to insert a CR/LF only when
> the line has text, but it does it every time. Why? I need help!
[quoted text clipped - 7 lines]
> IIf(IsNull([DonAddr6]),"",[DonAddr6] & Chr(13) & Chr(10)) &
> "Dear " & [DonSalPres] & ":"
Marshall Barton - 20 Oct 2005 20:15 GMT
>I am going crazy with this text box. I want it to insert a CR/LF only when
>the line has text, but it does it every time. Why? I need help!
[quoted text clipped - 7 lines]
>IIf(IsNull([DonAddr6]),"",[DonAddr6] & Chr(13) & Chr(10)) &
>"Dear " & [DonSalPres] & ":"
Maybe the addr field aren't really Null? If they might be a
zero length string, then use:
IIf(Nz([DonAddr1],"")=""), . . .

Signature
Marsh
MVP [MS Access]