Avatar of Uptime Legal Systems
Uptime Legal Systems
Flag for United States of America asked on

Access, HTML email, memo fields and new lines/carriage returns

Hello;

I've built a function in our access database that generates an HTML email and populates some of the body of the email from a few different records in the database.  (So I've essentially wrapped HTML within access code by setting .HTMLBody = "htmlCodeHere").

I used to send this email out using SendObject format TXT, now writing this to create a pretty HTML email.

It works great, with one exception:  I have a memo field in the database where users enter data: some times sentences, some time paragraphs, always with several carriage returns/new lines.  The problem: HTML doesn't interpret these as enters/new lines when formulating the email.  

Example, if the memo field has the following data:

* line one here
* line two here
* line three here

It will output in the email as:

* line one here * line two here * line three here.

Obviously the HTML tag for new line is <br>, but how do I get the database or HTML to interpret the new lines in the memo field into a new line in the HTML code?

Thanks all.
Microsoft Access

Avatar of undefined
Last Comment
Uptime Legal Systems

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
mbizup

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Uptime Legal Systems

ASKER
Yes, I read it into a String.  Essentially:

strBody = me.Body
.htmlBody = strBody

So would I replace this with:

strBody = me.Body
.htmlBody = Replace(strBody),vbCRLF,"<br>")

?
Uptime Legal Systems

ASKER
That worked--thanks!
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck