Post Codes

G

Guest

I use this IIF formula;
=IIf([Address2] Is Null,[Address] & Chr(13) & Chr(10) & [Town] & Chr(13) &
Chr(10) & [County] & Chr(13) & Chr(10) & [Post Code],[Address] & Chr(13) &
Chr(10) & [Address2] & Chr(13) & Chr(10) & [Town] & Chr(13) & Chr(10) &
[County] & Chr(13) & Chr(10) & [Post Code])
To fill an Unbound text box for the address on reports. Obviously it
removes the unwanted empty line Address2 if there is nothing in it.
It works perfectly except for one little thing, It removes the space in my
post code without reason.
The post code is entered on forms with the usual input mask; >LL00\ 0LL;;_
and all looks well on the table. Does anyone know why or a format within the
above formula to resolve my dilema.
Many thanks in advance.
Andy....
 
K

Ken Snell \(MVP\)

I don't see anything in the expression that should cause the loss of a space
in the PostCode. I'd check your data to be sure the space is there in the
table.

As for the expression, here's an easier way to do what you seek (watch for
line-wrapping; expression is a single line):

=[Address] & Chr(13) & Chr(10) & ([Address2] + Chr(13) + Chr(10)) & [Town] &
Chr(13) & Chr(10) & [County] & Chr(13) & Chr(10) & [Post Code]
 
G

Guest

Many Thanks Ken
Your formula works perfectly for address display on the reports and by
adding the '0' in the input mask i.e. >LL00\ 0LL;0;_ the space is stored
where it wasn't before.
Problem solved, Thanks.
Andy.....
 

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