how to insert CRLF (carrage return/line feed) in report

S

Suzzy Q

Hi

on my report I have a variable where I have: "text" & [variable] & "more
text" & "another paragraph"

Well between the "more text" and "another paragraph", I need to put in a
carriage return and 2 line feed so it will have a space between the
paragraphs. What is the code for that??? In the old BASIC days it was
something like chr$(13) & chr$(10)

thanks.
 
J

Jeff Boyce

You might give a try to "vbCRLF" (repeat as needed).


Regards

Jeff Boyce
Microsoft Office/Access MVP
 
S

Suzzy Q

Nope it didn't like that. I used "text" & vbCRLF & "text" and it turned the
vbCRLF into a field like [vbCRLF]

I tried it with the quotes and of course all I got was the actually letters
v b C R L F.

I did find out the report box did accept a "soft-return" when you press your
Shift-Enter. So I did get my line spacing correct.

But if anyone else does how to code it, I would like to see how to do it
just incase for the next time........

Thanks again.

Jeff Boyce said:
You might give a try to "vbCRLF" (repeat as needed).


Regards

Jeff Boyce
Microsoft Office/Access MVP

Suzzy Q said:
Hi

on my report I have a variable where I have: "text" & [variable] & "more
text" & "another paragraph"

Well between the "more text" and "another paragraph", I need to put in a
carriage return and 2 line feed so it will have a space between the
paragraphs. What is the code for that??? In the old BASIC days it was
something like chr$(13) & chr$(10)

thanks.
 
J

John Spencer

In a query and most of the time in controls you need Chr(13) & Chr(10)

"Text" & Chr(13) & Chr(10) & "More text" & Chr(13) & Chr(10) & Chr(13) &
Chr(10) & "even More Text"

Text
More Text
<<< Blank line>>
Even more Text


John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County

Suzzy said:
Nope it didn't like that. I used "text" & vbCRLF & "text" and it turned the
vbCRLF into a field like [vbCRLF]

I tried it with the quotes and of course all I got was the actually letters
v b C R L F.

I did find out the report box did accept a "soft-return" when you press your
Shift-Enter. So I did get my line spacing correct.

But if anyone else does how to code it, I would like to see how to do it
just incase for the next time........

Thanks again.

Jeff Boyce said:
You might give a try to "vbCRLF" (repeat as needed).


Regards

Jeff Boyce
Microsoft Office/Access MVP

Suzzy Q said:
Hi

on my report I have a variable where I have: "text" & [variable] & "more
text" & "another paragraph"

Well between the "more text" and "another paragraph", I need to put in a
carriage return and 2 line feed so it will have a space between the
paragraphs. What is the code for that??? In the old BASIC days it was
something like chr$(13) & chr$(10)

thanks.
 
J

Jeff Boyce

OK, the vbCRLF works some places (must be VBA) and not others (e.g.,
queries). I'd next try what you started with, Chr(10) & Chr(13).

Regards

Jeff Boyce
Microsoft Office/Access MVP

Suzzy Q said:
Nope it didn't like that. I used "text" & vbCRLF & "text" and it turned
the vbCRLF into a field like [vbCRLF]

I tried it with the quotes and of course all I got was the actually
letters v b C R L F.

I did find out the report box did accept a "soft-return" when you press
your Shift-Enter. So I did get my line spacing correct.

But if anyone else does how to code it, I would like to see how to do it
just incase for the next time........

Thanks again.

Jeff Boyce said:
You might give a try to "vbCRLF" (repeat as needed).


Regards

Jeff Boyce
Microsoft Office/Access MVP

Suzzy Q said:
Hi

on my report I have a variable where I have: "text" & [variable] & "more
text" & "another paragraph"

Well between the "more text" and "another paragraph", I need to put in a
carriage return and 2 line feed so it will have a space between the
paragraphs. What is the code for that??? In the old BASIC days it was
something like chr$(13) & chr$(10)

thanks.
 
F

fredg

Hi

on my report I have a variable where I have: "text" & [variable] & "more
text" & "another paragraph"

Well between the "more text" and "another paragraph", I need to put in a
carriage return and 2 line feed so it will have a space between the
paragraphs. What is the code for that??? In the old BASIC days it was
something like chr$(13) & chr$(10)

thanks.


In VBA you can use vbNewLine, or vbCrLf or chr(13) & chr(10).

"text" & [variable] & "more text" & vbNewLine & vbNewLine & "another
paragraph"

Directly in an Access control or query, you must use only
chr(13) & chr(10)
in that order.
 
S

Suzzy Q

That's it. It worked.

thanks


John Spencer said:
In a query and most of the time in controls you need Chr(13) & Chr(10)

"Text" & Chr(13) & Chr(10) & "More text" & Chr(13) & Chr(10) & Chr(13) &
Chr(10) & "even More Text"

Text
More Text
<<< Blank line>>
Even more Text


John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County

Suzzy said:
Nope it didn't like that. I used "text" & vbCRLF & "text" and it turned
the vbCRLF into a field like [vbCRLF]

I tried it with the quotes and of course all I got was the actually
letters v b C R L F.

I did find out the report box did accept a "soft-return" when you press
your Shift-Enter. So I did get my line spacing correct.

But if anyone else does how to code it, I would like to see how to do it
just incase for the next time........

Thanks again.

Jeff Boyce said:
You might give a try to "vbCRLF" (repeat as needed).


Regards

Jeff Boyce
Microsoft Office/Access MVP

Hi

on my report I have a variable where I have: "text" & [variable] &
"more text" & "another paragraph"

Well between the "more text" and "another paragraph", I need to put in
a carriage return and 2 line feed so it will have a space between the
paragraphs. What is the code for that??? In the old BASIC days it was
something like chr$(13) & chr$(10)

thanks.
 
J

John Spencer

Skippy!!!

YOU know better. It is always Chr(13) & Chr(10).

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County

Jeff said:
OK, the vbCRLF works some places (must be VBA) and not others (e.g.,
queries). I'd next try what you started with, Chr(10) & Chr(13).

Regards

Jeff Boyce
Microsoft Office/Access MVP

Suzzy Q said:
Nope it didn't like that. I used "text" & vbCRLF & "text" and it turned
the vbCRLF into a field like [vbCRLF]

I tried it with the quotes and of course all I got was the actually
letters v b C R L F.

I did find out the report box did accept a "soft-return" when you press
your Shift-Enter. So I did get my line spacing correct.

But if anyone else does how to code it, I would like to see how to do it
just incase for the next time........

Thanks again.

Jeff Boyce said:
You might give a try to "vbCRLF" (repeat as needed).


Regards

Jeff Boyce
Microsoft Office/Access MVP

Hi

on my report I have a variable where I have: "text" & [variable] & "more
text" & "another paragraph"

Well between the "more text" and "another paragraph", I need to put in a
carriage return and 2 line feed so it will have a space between the
paragraphs. What is the code for that??? In the old BASIC days it was
something like chr$(13) & chr$(10)

thanks.
 
J

Jeff Boyce

I don't. I so rarely use it I have to look it up each time...

Skipp

John Spencer said:
Skippy!!!

YOU know better. It is always Chr(13) & Chr(10).

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County

Jeff said:
OK, the vbCRLF works some places (must be VBA) and not others (e.g.,
queries). I'd next try what you started with, Chr(10) & Chr(13).

Regards

Jeff Boyce
Microsoft Office/Access MVP

Suzzy Q said:
Nope it didn't like that. I used "text" & vbCRLF & "text" and it turned
the vbCRLF into a field like [vbCRLF]

I tried it with the quotes and of course all I got was the actually
letters v b C R L F.

I did find out the report box did accept a "soft-return" when you press
your Shift-Enter. So I did get my line spacing correct.

But if anyone else does how to code it, I would like to see how to do it
just incase for the next time........

Thanks again.

You might give a try to "vbCRLF" (repeat as needed).


Regards

Jeff Boyce
Microsoft Office/Access MVP

Hi

on my report I have a variable where I have: "text" & [variable] &
"more text" & "another paragraph"

Well between the "more text" and "another paragraph", I need to put in
a carriage return and 2 line feed so it will have a space between the
paragraphs. What is the code for that??? In the old BASIC days it
was something like chr$(13) & chr$(10)

thanks.
 

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