Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Memo fields containing html identifiers

Status
Not open for further replies.

PJname

MIS
Jun 15, 2004
73
US
Question:

Is there a way to remove the html identifiers that show up in a memo type field when using Microsoft Access?

<html> This is an example </html>

Would like the field to only show: This is an example
 
As a starting point you may create the following function in a standard code module:
Code:
Public Function ridTags(myStr)
If Trim(myStr & "") = "" Then Exit Function
Dim newStr As String, i As Integer, flg As Boolean, x As String
For i = 1 To Len(myStr)
  x = Mid(myStr, i, 1)
  If flg Then
    If x = ">" Then flg = False
  Else
    If x = "<" Then
      flg = True
    Else
      newStr = newStr & x
    End If
  End If
Next i
ridTags = newStr
End Function

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thank you PHV for your post.

I tried your suggestion by using the module and it excluded most of the "trash" in the field.

A couple of questions:



1) how do you get rid of the carriage returns (line Breaks)

and

2) how can it be coded to exclude the following lines:



this is how some of the fields show up (see below):

field results:
((((( I assume the blanks are carriage returns )))))
-----------------------------------------------------------





P { font: normal 8pt Arial; margin: 0 0 0 0 }
BODY { font: normal 8pt Arial; margin: 0 0 0 0 }


1N19C003C/MOTOR - CONDENSATE PUMP C MOTOR


Would like to blank out the P { line and the Body { lines from the field results.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top