lolmustache
lolmustache

Reputation: 11

Email output adding line breaks when inserting variables into email body using Access VBA

I have an email that's being automatically generated and filling the body with results from a query. It is outputting query result items on separate lines.

The Results appear like:

LOB:

Comments

But Should Appear as:

LOB: Comments

strQryResults = strQryResults & "<li><span style='color:#000000;font-family:arial;'>" & ![LOB] & ": " & ![Comments] & "</Span>" & vbCrLf
.MoveNext

How can I remove these line breaks?

When I do Left(![Comments], 4) I see:

<div 

This is what's creating the new line, but what's creating the

<div>

Upvotes: 0

Views: 46

Answers (1)

lolmustache
lolmustache

Reputation: 11

Updated to show answer/workaround:

In order to remove the unnecessary div tags, I replaced ![Comments] with:

Mid(![Comments], 6, Len(![Comments]) - 5)

Upvotes: 1

Related Questions