Changing memo field

D

DIH

I have a form called frmInputBath. In this form is a bound textbox
called txtProblems. The field property is set to Memo. I would like to
enter one line of text and press enter to have it drop to a new line.
When all the lines of text are entered, I have a report that prints this
text out. I want to have the report condense the individual lines of
text into a paragraph form (with a carriage return 'box' character)
showing where the user pressed the enter key (otherwise the report size
will be very large). In other words, I would like it to work the same as
when importing text from an excel spreadsheet into Access.

e.g.

FIRST PROBLEM CODE GOES ON THIS LINE
SECOND PROBLEM WOULD GO HERE
THIRD CODE PROBLEM GOES HERE
DONE

I want it to look like this in the report:

FIRST PROBLEM CODE GOES ON THIS LINE[]SECOND PROBLEM WOULD GO
HERE[]THIRD CODE PROBLEM GOES HERE[]DONE


Any help would be greatly appreciated!

Dave
 
C

carletta Bell

DIH said:
I have a form called frmInputBath. In this form is a bound textbox called
txtProblems. The field property is set to Memo. I would like to enter one
line of text and press enter to have it drop to a new line. When all the
lines of text are entered, I have a report that prints this text out. I
want to have the report condense the individual lines of text into a
paragraph form (with a carriage return 'box' character) showing where the
user pressed the enter key (otherwise the report size will be very large).
In other words, I would like it to work the same as when importing text
from an excel spreadsheet into Access.

e.g.

FIRST PROBLEM CODE GOES ON THIS LINE
SECOND PROBLEM WOULD GO HERE
THIRD CODE PROBLEM GOES HERE
DONE

I want it to look like this in the report:

FIRST PROBLEM CODE GOES ON THIS LINE[]SECOND PROBLEM WOULD GO HERE[]THIRD
CODE PROBLEM GOES HERE[]DONE


Any help would be greatly appreciated!

Dave
 
G

Guest

Hi Dave,

Try the following for a memo field named "MyMemoField", in a table named
"Table1". Make the appropriate substitutions in your case:

SELECT Table1.MyMemoField,
Replace([MyMemoField],Chr(13)+Chr(10),"[]") AS CondensedMemoField
FROM Table1;

This seems to work okay in my limited testing, as long as you are not using
rich text in the memo field.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 

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