Field has HTML and Plain Text (1 Viewer)

primmer3001

New member
Local time
Today, 14:33
Joined
Sep 26, 2017
Messages
3
Hi All

I am new to access Forms and I am struggling to get my form to work correctly. I have pulled data from and application used at work called KANA. I have a field that has html and plain text data in due to how the email is received. I need to find a way of having the data either just text will all the html tags removed or show the field as both depending on the data.

I have tried adding Me.NameOfRichTextbox = [NameOfFieldWithHTMLstring] in the On Current bit to the right and it didn't work. I am using Access 2016.

I have also made sure the the Textbox used has the Text Format as Rich Text aswell
 
Last edited:

plog

Banishment Pending
Local time
Today, 08:33
Joined
May 11, 2011
Messages
11,657
I don't think Rich Text is the same as HTML. My advice is to build a custom function to strip out all html tags of your field and go with plain text.

It would be pretty simple function--all html tags start with a < and end with a >. So you would just build a function that goes through the whole string stopping and starting when it encounters those characters.
 

isladogs

MVP / VIP
Local time
Today, 14:33
Joined
Jan 14, 2017
Messages
18,247
Have you tried this:

Code:
PlainText([NameOfFieldWithHTMLstring])
 

primmer3001

New member
Local time
Today, 14:33
Joined
Sep 26, 2017
Messages
3
Hi Colin, I have tried adding PlainText([NameofField]) in the Control Source under the Data tab in Properties to no avail.
 

isladogs

MVP / VIP
Local time
Today, 14:33
Joined
Jan 14, 2017
Messages
18,247
You could try creating a query with 2 columns:
[NameOfField] and PlainText([NameOffield])

It worked for me.
 

Users who are viewing this thread

Top Bottom