PDA

View Full Version : Adding Space/Enter Before Query Question


theflyingminstr
08-31-2008, 12:56 AM
Hi I am doing a search and replace query but I need to add a carriage return before and after the string-to-change before parsing.

I tried these and I think #1 added the returns but not before parsing..

1. Thetext= "<br>" & Thetext & "<br>"

2. Thetext= VbCrLf & Thetext & VbCrLf

I was looking into Len functions but I wasn't quite sure how to apply it properly.. Any help would be much appreciated.

Thank you

Bullschmidt
09-03-2008, 07:35 AM
Seems like the Replace() function could come in handy for something like that.

MyStringVarAdjusted = Replace(MyStringVar, "<br>", vbCrLf)

hinch
09-03-2008, 11:19 AM
Thetext= "<br>" & Thetext & "<br>"

would work but you need to put it BEFORE you start parsing Thetext not after :)