We help IT Professionals succeed at work.

Ms Access 2007 text box formatting problem

smurray20
smurray20 asked
on
I have a text box on a MS Access report.
The source is a memo field in a table that I have imported from a SQL Server database.

When I display the field in a report none of the formatting is preserved, instead all the text runs together in one line.
How can I fix this so it preserves line breaks and carriage returns?

Thanks
Suzanne
Comment
Watch Question

Scott McDaniel (EE MVE )Infotrakker Software
SILVER EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
Have you set the report control;s Text Format property to RichText?

Author

Commented:
Yes, have tried this but it doesn't make any difference.
Any other ideas?
Scott McDaniel (EE MVE )Infotrakker Software
SILVER EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
If you view the data on a Form, is it formatted correctly?

Author

Commented:
yes
Scott McDaniel (EE MVE )Infotrakker Software
SILVER EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
Did you check that the RichText property is set in both the Table and the Report?
Jim HornSQL Server Data Dude
BRONZE EXPERT
Most Valuable Expert 2013
Author of the Year 2015

Commented:
>I have a text box on a MS Access report.
Try using a RichTextBox control instead of a textbox.  
From Report Design, Toolbox toolbar, click on the toolbox icon with three dots, then scroll down to 'Microsoft RichTextBox (some version)'.
Left-click, hold, and drag like you were adding a textbox.
Once it's set, do a right-click:Properties, and set the Control source.

Author

Commented:
Will those work if I have to convert the database to a 97-2002 compatible one?
Scott McDaniel (EE MVE )Infotrakker Software
SILVER EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
The only way to show RichText in older versions is to do as jimhorn suggests and use an ActiveX control. Even then, you can't use those in Reports.

Stephen Lebans has a fix for that: http://www.lebans.com/richtext.htm

Or you can use the FMS Total Access Memo: http://www.fmsinc.com/MicrosoftAccess/memo.html
I actually managed to solve the problem myself!

= Replace([myfield],Chr(13), Chr(13))

I'm not sure why this worked but it did!

Thanks for trying to help though!
Suzanne

Author

Commented:
How do I close the question?

Commented:
I am having the same problem on my report.  I tried using a RichTextBox control and that worked, but I do not see an option for "Can Grow" and "Can Shrink" on the RichTextBox control.  I do not understand what was meant in the solution: = Replace([myfield],Chr(13), Chr(13))
I put this in the Format property in the Textbox, but all it did was truncate the text.  Any help?  Thanks.
Jim HornSQL Server Data Dude
BRONZE EXPERT
Most Valuable Expert 2013
Author of the Year 2015

Commented:
>Any help?
Certainly.  Ask it as your own question, instead of piggy-backing on one that hasn't been commented on since January.
That way, all experts will see it.
This way, only the experts that commented in this question will see it, and since there are no points up for grabs, motivation is somewhat low.

Commented:
What this means that you can write a VBA script to replace the chr(13). It worked for me with a modified version. i.e. = Replace([myfield],Chr(13), Chr(13) & Chr(10)).

Explore More ContentExplore courses, solutions, and other research materials related to this topic.