Plain text in RichEdit control

Posted by: lukie on 4 August 2017, 3:00 pm EST

  • Posted 4 August 2017, 3:00 pm EST

    I have a report where the detail-section contains a RichEdit control. When the data is not richtext, the control shows nothing.

    I've already checked but this doesn't help.

    I'm using build

    Any idea ?

  • Replied 4 August 2017, 3:00 pm EST

    Is the data mixed as RTF and text in the same column in the database table? If that is the case, you can read that column in FetchData into a string variable. In Detail format check if the first character in the string is "{" then the text is RichText :

    Private Sub Detail_Format()
        If Left(memo, 1) = "{" Then
            Me.RichEdit1.TextRTF = memo
            Me.RichEdit1.Text = memo
        End If
    End Sub

    This won't work if the plain text values start with the character "{" which is unlikely.
  • Replied 4 August 2017, 3:00 pm EST

    Great !

    Exactly what I needed !
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels