Paragraph marks

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table that is populated with data from a website. One column is
called messages. If the message that is entered on the website into the
messages column contains two separate paragraphs, what is entered into the
database looks like this:

<p>Hello this is a test message<p/>
<p>ok?<p/>


When I run a report I comes out like above, how do I get it to come out like:

Hello this is a test message

OK?

If I remove the marks in the table, it affects the way it shows on the
website, so I cannot change the data in the table.

Thanks for any help.
 
One simple way:

In the query that your report is based on set the Messages field to:
Messages: Replace(MyTable.Messages,"<p>","")

Then for the ControlSource of the field in you report:
=Replace(MyTable.Messages,"</p>",Chr$(13) & Chr$(10) & Chr$(13) & Chr$(10))

Otherwise you could create a Function to return the string with appropriate
replacements.

Steve
 
If the HTML tags are the same all the time (or at least are the same length)
you could make a query from the table, with a calculated field:

NoTags: Mid([YourField],4,Len([YourField])-7)

If the start and end tags vary it will be a bit more complex, something
like:
NoTags:
Left(Right([YourField],Len([YourField])-InStr([YourField],">")),InStr(Right([YourField],Len([YourField])-InStr([YourField],">")),"<")-1)
 
Back
Top