Solved

RTF memo field: what is text value?

Posted on 2012-04-01
10
503 Views
Last Modified: 2012-06-22
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!
0
Comment
Question by:terpsichore
10 Comments
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
What is the code you have ?

And what about just one space ?

mx
0
 

Author Comment

by:terpsichore
Comment Utility
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
 
LVL 2

Expert Comment

by:Kelden
Comment Utility
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
 
LVL 45

Expert Comment

by:Martin Liss
Comment Utility
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
 

Author Comment

by:terpsichore
Comment Utility
not sure I follow you... what is "selRTF"?
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 45

Expert Comment

by:Martin Liss
Comment Utility
selRTF is used when you want to replace the selected portion of text in a RTB.
0
 

Author Comment

by:terpsichore
Comment Utility
I'm using Access 2010, it says that property is not available.
0
 
LVL 45

Expert Comment

by:Martin Liss
Comment Utility
Well I guess you don't need it since I assume you are not manually selecting any portion of the text.
0
 

Accepted Solution

by:
terpsichore earned 0 total points
Comment Utility
I found the answer: use the PLAINTEXT function - this solves it perfectly.
0
 

Author Closing Comment

by:terpsichore
Comment Utility
this function is exactly what I was looking for.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now