CR/LF in Access Report?

G

Guest

Is it possible to force a carriage return / line feed in a text field in an
Access report? I've tried syntax like:

=[Field1] & chr(10) & [Field2]
=[Field1] & chr(13) & [Field2]
=[Field1] & chr(10) & chr(13) & [Field2]

But none of the above cause a CRLF between the two fields. Is it possible
to do this?
 
R

Rick Brandt

Chris B said:
Is it possible to force a carriage return / line feed in a text field in an
Access report? I've tried syntax like:

=[Field1] & chr(10) & [Field2]
=[Field1] & chr(13) & [Field2]
=[Field1] & chr(10) & chr(13) & [Field2]

But none of the above cause a CRLF between the two fields. Is it possible
to do this?

You tried all combinations but the correct one. You need both Chr(13) & Chr(10)
and in that order.
 
M

Mike Painter

Chris said:
Is it possible to force a carriage return / line feed in a text field
in an Access report? I've tried syntax like:

=[Field1] & chr(10) & [Field2]
=[Field1] & chr(13) & [Field2]
=[Field1] & chr(10) & chr(13) & [Field2]

But none of the above cause a CRLF between the two fields. Is it
possible to do this?

=[Field1] & vbCRLF & [Field2]

see "visual basic constants" in VB help.
 
D

Duane Hookom

You can't use vba constants outside of modules.

--
Duane Hookom
MS Access MVP


Mike Painter said:
Chris said:
Is it possible to force a carriage return / line feed in a text field
in an Access report? I've tried syntax like:

=[Field1] & chr(10) & [Field2]
=[Field1] & chr(13) & [Field2]
=[Field1] & chr(10) & chr(13) & [Field2]

But none of the above cause a CRLF between the two fields. Is it
possible to do this?

=[Field1] & vbCRLF & [Field2]

see "visual basic constants" in VB help.
 
M

Mike Painter

Duane said:
You can't use vba constants outside of modules.

Oops, That's what happens when I ask my dog to answer a question.
It's not all his fault, he's about 99% deaf.
 
D

Duane Hookom

A man and his dog walk into an Access users group meeting. They sit in the
back and every time someone says "report", the dog barks once...
 

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