Report: Multiple lines in a textbox from a field

J

John Keith

I am having trouble making my report do what is needed...

In a textbox I can assign a formula like: ="Line1" & chr(13) & chr(10) &
"Line2"
which shows in the textbox as...
Line1
Line2

I am attempting to use a control source that is a query-field that has been
built with the embedded CR LF chars. The result is the unprintable boxes
instead of line breaks. I have tried with Just chr(10), Just chr(13), and
both combinations of each. In all 4 cases I get the boxes when the report is
run.

What am I doing wrong? Is there someway I can put the field into a function
that will force access to interpret the CRLFs?
 
A

Allen Browne

The CR LF pair (13, then 10) is correct. It will work correctly as embedded
characters, unless something else is going on.

Is this A2007? Is the text box's Text Format set to Rich Text?

Are you sure you have the 13 before the 10?

Could there be other characters in the field?

Can you use Asc() with Mid() in the Immediate Window (Ctrl+G) to ascertain
what's going on?
 
J

John Keith

Access 2003;
Im using Dev Ashish's fConcatChild to merge multiple students into one
household record. fConcatChild was modified to allow optional parms that
contain a seperator string and a number of tab-columns to allow...

Tab-columns was my culprit!... I forgot that I had to use tab chr(9) to pass
the data to a mailmerge in word and I was still calling the function with
that last optional parm set to 2 which was forcing the Word required chr(10)
only at the end of each 2 students. Once I blanked out that last parm, it
starting working properly.

Thanks for asking the questions to get me to dig deeper!

Chr(13)&Chr(10) does work

--
Regards,
John


Allen Browne said:
The CR LF pair (13, then 10) is correct. It will work correctly as embedded
characters, unless something else is going on.

Is this A2007? Is the text box's Text Format set to Rich Text?

Are you sure you have the 13 before the 10?

Could there be other characters in the field?

Can you use Asc() with Mid() in the Immediate Window (Ctrl+G) to ascertain
what's going on?
 

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