Add a line break/paragraph

  • Thread starter Thread starter LJG
  • Start date Start date
L

LJG

I Have table that has imported data from a spreadsheet. the field data has a
marker <p> to indicate that this should be a new paragraph.

Can anyone tell me what I would need to create an update query to insert the
paragraphs as required?

Thanks in advance

Les
 
Thanks for that, I cannot use that as a search and replace as it just
changes <p> with Chr(10)

CanI do this in the query window?

Thanks
Les
 
There is a replace function you can use in vb to create a function that you
can then use in your update queary:

Public Function TextReplace (OriginalTxt as string) as string

If not isnull(OriginalTxt) then
TextReplace = replace(OriginalTxt,"<p>",Chr(10))
else
TextReplace = ""
end if

end function

Then make an update query with TextReplace([FieldName]) as your update to.
I have not tried this so beware of typos, but you may also have to use a CR
(chr(13))

Somebody else may have a better suggestion. Also make sure you backup the
data first.
 
I Have table that has imported data from a spreadsheet. the field data has a
marker <p> to indicate that this should be a new paragraph.

Can anyone tell me what I would need to create an update query to insert the
paragraphs as required?

Access needs two characters - carriage return and linefeed - in
succession to serve as a paragraph mark.

Try running an Update query; update the field to

Replace([fieldname], "<p>", Chr(13) & Chr(10))


John W. Vinson[MVP]
 
Back
Top