multiple line breaks on form

G

Guest

I have a form set up to display store locations (shopping center, address,
city, state, zip) and phone numbers. My users want to be able to highlight
the displayed data as one item so they can copy and paste it into emails.
Currently, I just have the info set up simply, with one box for each field,
so they have to copy each field individually. I've been trying to create a
large box with some expression string that will show the same info as one
item (basically, it will look the same, but users can copy all the info at
once instead of each field individually). I just need to know how to put
line breaks between some of the info, so that it displays like this:

Shopping Center
Address
City, State ZIP
Phone #

I put an unbound box on my form, and used the Expression Builder to come up
with

[Mall/Shopping Center] & [Address] & [City] & ", " & [State] & " " & [ZIP]

but I couldn't figure out how to enter line breaks where needed. Searching
thru the discussion groups, I came up with this:

=replace([testString], ". ", "." & Chr(13) & Chr(10))

which is fine when I substitute [Shopping Center] for [testString], but how
do I connect the next field (Address) after the line break, followed by
another line break, etc.? I know nothing about Visual Basic; I always use
the Expression Builder, so if you could respond with that in mind, I'd really
appreciate it. Thanks so much for any assistance.
 
J

John W. Vinson

which is fine when I substitute [Shopping Center] for [testString], but how
do I connect the next field (Address) after the line break, followed by
another line break, etc.? I know nothing about Visual Basic; I always use
the Expression Builder, so if you could respond with that in mind, I'd really
appreciate it. Thanks so much for any assistance.

You don't need the Replace() function at all, except to change the contents of
an existing field. Just set the control source to

[Mall/Shopping Center] & Chr(13) & Chr(10) & [Address] & Chr(13) & Chr(10) &
[City] & ", " & [State] & " " & [ZIP]

using the & Chr(13) & Chr(10) wherever you want a linebreak.

John W. Vinson [MVP]
 

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