Formatting 2 part address

P

PSI-Access

I have created a subreport that lists the address for people in our database.
Some of our people have two part addresses coming from Addr1 and Addr2
fields. I have tried putting the addresses in separate text fields in the
report and have formatted them to shrink but it just leave a blank space if
the Addr2 field is empty. I have also tried to make the height of the Addr2
field 0 and then put the properties of the field to 'grow' if neccesary but
that too brings unfavorable results. There is a City and State text box below
the Addr1 field. If I concatenate the Addr1 and Addr2 fields it seems best
however now we have people that have a combined Addr1 and Addr2 address that
is too long for the space I have available horizontally for the address. I
would ideally like to make it so that I can put into the text field a line
space but I dont' know what character to enter for a line space. Any one have
any experience adding a line break in a text field???

=[Addr1] & IIF(IsNull([Addr2]), "", ", " & [Addr2])
maybe it should read something like ...
=[Addr1] & IIF(IsNull([Addr2]), "", vbcrlf & ", " & [Addr2])

Thanks for your help!!!
 
J

jl5000

Try this:
=nz([Addr1],"") & (Chr(13) + Chr(10)) & nz([Addr2],"")

nz works like the IIF you are trying to build, just easier syntax
 
J

jl5000

Try:

=nz([Addr1],"") & (chr(13)+chr(10)) & nz([Addr2],"")

keep the grow property set to Yes

note: nz works like the iif(isnull, just simplier syntax
 

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