Carriage Returns... Avoid Blank Space

D

Dee

I have the formula below that gives me basically what I want, only I end up
with blank space. First I'll give you the code and then the example of how
it shows up. I appreciate any help anyone can give - hopefully tonight :).

=IIf(IsNull([firstname]),"","" & [firstname]) & IIf(IsNull([Last Name]),"","
" & [Last Name]) & Chr(13) & Chr(10) & [CHCompany] &
IIf(IsNull([Division]),""," " & [Division]) & Chr(13) & Chr(10) &
IIf(IsNull([Address]),"","" & Chr(13) & Chr(10) & [Address]) &
IIf(IsNull([Address2]),"","" & Chr(13) & Chr(10) & [Address2]) & Chr(13) &
Chr(10) & IIf(IsNull([City]),"","" & [City]) & IIf(IsNull([State]),"",", " &
[State]) & IIf(IsNull([Zip]),""," " & [Zip]) & IIf(IsNull([Country]),""," "
& Chr(13) & Chr(10) & [Country]) & Chr(13) & Chr(10) &
IIf(IsNull([Phone]),"","Phone: " & [phone]) & Chr(13) & Chr(10) &
IIf(IsNull([Fax]),"","Fax: " & [fax]) & Chr(13) & Chr(10) &
IIf(IsNull([mobile]),"","Mobile: " & [mobile]) & Chr(13) & Chr(10) &
IIf(IsNull([pager]),"","Pager: " & [pager]) & Chr(13) & Chr(10) &
IIf(IsNull([homephone]),"","Home Phone: " & [homephone]) & Chr(13) &
Chr(10) & IIf(IsNull(),"","Email: " & [email])

Example Output:

FirstName LastName
Company

Address2
City, State Zip
Country
Phone: 111.111.1111
Fax: 111.111.1111



Email: [email protected]

Since there is no Address, no Mobile, no pager, and no home phone, they show
up as blank lines instead of all together. How can I fix this? I'm sure
it's simple, I just don't know :).

Thanks!

Dee
 
Top