Link to home
Start Free TrialLog in
Avatar of Dustin Stanley
Dustin Stanley

asked on

MS Access How To Append and Prepend a String To Each line In a Table Field Value

I am trying to make a query or something for that matter to Append  <span><li> and Prepend  </span></li>

"<span><li>" & Line value in table field & "</span></li>"

Example:

Color: Yellow
Length: 19 Inches long
Type: Metal

Would be:

<span><li>Color: Yellow</span></li>
<span><li>Length: 19 Inches long</span></li>
<span><li>Type: Metal</span></li>

This is a description field for me. I am exporting this info to a server that doesn't understand "CRLF"  Even though I have the information in the CDATA.

The server is reading
Color: Yellow CRLF
Length: 19 Inches long CRLF
Type: Metal CRLF

as Color: Yellow Length: 19 Inches long Type: Metal

Thanks for the help.
ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dustin Stanley
Dustin Stanley

ASKER

Thanks Norie but can you give me an example of how to use this? Would I place it in the VBA directly instead of my String called "SkuDescrip"?

OR would I generate this in a file or in memory of its own then pass it to the VBA??

I hope that makes sense.  i see what you are saying but lost at how to use correctly. Thanks.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Perfect! Thanks for the help Norie!
Just to help anyone in the future I used this in a query and if the value is Null then this will show an error. If it is blank then it will add the Span anyways. So what I did was added the IIf Function like below:

skuDescrHTML: IIf([SkuDescr] & " " = " ","","<span><li>" & Replace([SkuDescr],Chr(10),"</span></li><span><li>") & "<span><li>")

Open in new window