Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vbCrLf / + Chr(13) + Chr(10) Carriage Returns in A Report

Status
Not open for further replies.

plengeb

Programmer
Sep 23, 2011
10
US
= "HX: PF | EPF | DET | COMP" + Chr(13) + Chr(10) & "EX: PF | EPF | DET | COMP"

I am storing the above string in a table. The forms and reports are currently displaying the string exactly as above. When a form or report pulls the field, I would like it to do the carriage returns and appear as below.

HX: PF | EPF | DET | COMP"
EX: PF | EPF | DET | COMP

Does anyone know of a way to get the forms and reports to recognize the carrage returns?

Thanks a bunch.

Bill
 
I updated a field in a table using this expression:
"HX: PF | EPF | DET | COMP" + Chr(13) + Chr(10) & "EX: PF | EPF | DET | COMP"
When I added this field to a text box in a report, it appeared on two lines.

HX: PF | EPF | DET | COMP
EX: PF | EPF | DET | COMP



Duane
Hook'D on Access
MS Access MVP
 
I tried it, and it's still doing the same thing on mine. I presently have the field formatted as memo. How is yours formatted?
 
I tried in a text 255 field. Maybe I'm confused by what exactly you are storing. When you view your data in table/datasheet view, do you see the "Chr(13) + Chr(10)", or small squares, or are there two lines?

If you see Chr(13) + Chr(10) you could try a control source in your report using Replace()

Code:
=Replace([Your Field Name],"Chr(13) + Chr(10)", Chr(13)&Chr(10))

Duane
Hook'D on Access
MS Access MVP
 
It's currently stored in a table as a memo field. I have it as = "HX: PF | EPF | DET | COMP" + Chr(13) + Chr(10) & "EX: PF | EPF | DET | COMP" in the field. When I run the report, I want it to show as two lines.

HX: PF | EPF | DET | COMP
EX: PF | EPF | DET | COMP

Do you know of a way to get the report to recognize the carriage returns, or do you know of another way to store the string in the field so this will work?
 
Thank you so much to everyone that responded. I found a solution on another forum that works, and I want to share it, with the hopes that it will help you in the future. The solution is to use the break code like you use for html, and then set the field on the report to Rich Text. The Rich Text enables the html to be interpreted.

HX: PF | EPF | DET | COMP<Br>EX: PF | EPF | DET | COMP<Br>MDM: SF | LOW | MOD | HIGH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top