RTF memo field: what is text value?

Hopefully an easy one - I am trying to do certain things when the value of a memo field is empty (if trimmed).
There is just a space in a field, so this code should be invoked, but it is not doing that, since the value of the field is, in fact, "<div>&nbsp;</div>".

I tried the 'text' property, but that returns the same thing.

Ideas?
Thanks!
terpsichoreAsked:
Who is Participating?
 
terpsichoreAuthor Commented:
I found the answer: use the PLAINTEXT function - this solves it perfectly.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
What is the code you have ?

And what about just one space ?

mx
0
 
terpsichoreAuthor Commented:
I'm just displaying the memo field on a form. It displays only a single space, nothing else (e.g., when I highlight contents, or when I type text and replace with just a space). When I put a breakpoint in the afterupdate and query the value, it says "<div>&nbsp;</div>".
But i want to detect when the field is empty or has just a space in it...
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
KeldenCommented:
You can check for text only. Insert the string in your RTF and read plain text only and check for empty string.

RTB.SelRTF = myString
If Trim(RTB.Text) = "" Then
    'Do whatever you need.
End If
0
 
Martin LissOlder than dirtCommented:
If you want to remove the non-btreaking space you should be able to do something like this,

Const strNBSP = "&nbsp;"

MyRTB.Text = Replace (MyRTB.Text, strNBSP, "")
0
 
terpsichoreAuthor Commented:
not sure I follow you... what is "selRTF"?
0
 
Martin LissOlder than dirtCommented:
selRTF is used when you want to replace the selected portion of text in a RTB.
0
 
terpsichoreAuthor Commented:
I'm using Access 2010, it says that property is not available.
0
 
Martin LissOlder than dirtCommented:
Well I guess you don't need it since I assume you are not manually selecting any portion of the text.
0
 
terpsichoreAuthor Commented:
this function is exactly what I was looking for.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.