Reputation: 629
I have a form with an unbound Rich Text textbox control (named: tbxNote). I am using the following code to update the target table (named: tblSupeGenNotes) with the values from various controls on the form:
dbs.Execute "UPDATE tblSupeGenNotes " & _
"SET [NoteDate] = #" & Me.tbxNoteDate & "#, " & _
"[SupeType] = " & Me.cbxSupeType & ", " & _
"[SupeAlerts] = " & alrt & ", " & _
"[Note] = " & Chr(34) & Me.tbxNote & Chr(34) & " " & _
"WHERE [SupeGenNoteID] = " & Me.tbxSupeGenNoteID & ";"
All data is getting into the target table in the correct fields with the correct values except that the [Note] field that pulls its data from the Rich Text textbox control (me.tbxNote) is including HTML tags in the table field result. For example, I get the following: "<<div>>Sample! {&}nbsp;I do not understand what is happening!<<\_div_>>". (Sorry, I had to "fake" the HTML tags because the forum changes it to HTML!)
How do I get rid of the HTML tags but maintain the HTML/rich text formatting?
Upvotes: 1
Views: 2849
Reputation: 629
AH! I figured it out. Hope this is useful to others:
I had only set the textbox control on the form to Rich Text. I needed to also go into the target data table itself (tblSupeGenNotes) and set the [Note] field to have a "Text Format" property of "Rich Text" instead of "Plain Text".
After making that change, the rich text displays properly on the form, and, the text with formatting is correctly transferred into the target table.
Upvotes: 1