G
Guest
I'm looking for help with this statement. I have created an address text box
with the following control. If any of the lines are null then the line will
not display and go onto the next. It's working fine except the line with
city, state and zip.
If Address 2, 3 & 4, city, state & zip are blank. I want it to look like this:
My Name
Address 1
Country
(Blank carriage return)
Attn:
But I'm getting this:
My Name
Address 1
(Blank carriage return)
(Blank carriage return)
Country
Attn:
I can't figure out what's wrong with the statement. I want the City, State
and Zip to stay on one line. But, if City, State and Zip are null, I want the
line to close up.
Here is the code I have:
=Trim([BILL_TO_NAME] & Chr(13) & Chr(10) & [BILL_TO_ADR1] &
IIf(IsNull([BILL_TO_ADR1]),Null,Chr(13) & Chr(10)) & [BILL_TO_ADR2] &
IIf(IsNull([BILL_TO_ADR2]),Null,Chr(13) & Chr(10)) & [BILL_TO_ADR3] &
IIf(IsNull([BILL_TO_ADR3]),Null,Chr(13) & Chr(10)) & [BILL_TO_ADR4] &
IIf(IsNull([BILL_TO_ADR4]),Null,Chr(13) & Chr(10)) & RTrim([BILL_TO_CITY]) &
IIf(IsNull([BILL_TO_CITY]),Null," " & [BILL_TO_STATE] &
IIf(IsNull([BILL_TO_STATE]),Null," " & [BILL_TO_ZIP] &
IIf(IsNull([BILL_TO_ZIP]),Null,Chr(13) & Chr(10))) & [BILL_TO_CNTRY] &
IIf(IsNull([BILL_TO_CNTRY]),Null,Chr(13) & Chr(10)) & "ATTN: " &
[BILL_TO_ATTN]))
with the following control. If any of the lines are null then the line will
not display and go onto the next. It's working fine except the line with
city, state and zip.
If Address 2, 3 & 4, city, state & zip are blank. I want it to look like this:
My Name
Address 1
Country
(Blank carriage return)
Attn:
But I'm getting this:
My Name
Address 1
(Blank carriage return)
(Blank carriage return)
Country
Attn:
I can't figure out what's wrong with the statement. I want the City, State
and Zip to stay on one line. But, if City, State and Zip are null, I want the
line to close up.
Here is the code I have:
=Trim([BILL_TO_NAME] & Chr(13) & Chr(10) & [BILL_TO_ADR1] &
IIf(IsNull([BILL_TO_ADR1]),Null,Chr(13) & Chr(10)) & [BILL_TO_ADR2] &
IIf(IsNull([BILL_TO_ADR2]),Null,Chr(13) & Chr(10)) & [BILL_TO_ADR3] &
IIf(IsNull([BILL_TO_ADR3]),Null,Chr(13) & Chr(10)) & [BILL_TO_ADR4] &
IIf(IsNull([BILL_TO_ADR4]),Null,Chr(13) & Chr(10)) & RTrim([BILL_TO_CITY]) &
IIf(IsNull([BILL_TO_CITY]),Null," " & [BILL_TO_STATE] &
IIf(IsNull([BILL_TO_STATE]),Null," " & [BILL_TO_ZIP] &
IIf(IsNull([BILL_TO_ZIP]),Null,Chr(13) & Chr(10))) & [BILL_TO_CNTRY] &
IIf(IsNull([BILL_TO_CNTRY]),Null,Chr(13) & Chr(10)) & "ATTN: " &
[BILL_TO_ATTN]))