Add a line break/paragraph

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
 
G

Guest

Try using the replace function with Chr(10) to replace the <p>. Chr(10) is
line feed.
 
L

LJG

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
 
G

Guest

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.
 
J

John Vinson

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top