Text Box Line Control?

D

David Habercom

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] & ":"
 
D

David Habercom

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.
 
M

Marshall Barton

David said:
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] & ":"


Maybe the addr field aren't really Null? If they might be a
zero length string, then use:

IIf(Nz([DonAddr1],"")=""), . . .
 

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