Carriage Return and Line Feed

J

JDR

How do I insert a carriage return and line feed in a text expression on a
report. i.e. print an address on 3 lines using carriage return and line
feed to accomplish.

Thanks

Jeff...
 
D

Douglas J. Steele

Carriage return is Chr(13), Line Feed is Chr(10). They MUST be in that
order: Chr(13) & Chr(10).

So if you've got fields Name, Address, City, State, Zip, you could set the
control for the text box on the form to:

= [Name] & Chr(13) & Chr(10) & [Address] & Chr(13) & Chr(10) & [CIty] & ", "
& [State] & " " & [Zip]

or you can add a computed field in your query and simply bind that computed
field to the text box.

In VBA, you can also use the intrinsic constant vbCrLf (but that won't work
in queries)
 
R

Rick Brandt

Dan said:
in a form text box, how could I enter freeform text but also use a LF-CR and
stay in the text box?

Either use Ctl-Enter or change the EnterKeyBehavior property for the
control.
 

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