Text Box Line Control?

G

Guest

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

Guest

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

Similar Threads

Address box with IIf Statement 7
Text box incomplete in GroupFooter 0
Rich Text Format 0
P.O. Box and concatenation hiccup 2
Formating Text 1
Envelopes ... need all caps 2
Post Codes 2
Iff in address block 1

Top