?
Solved

RTF memo field: what is text value?

Posted on 2012-04-01
10
Medium Priority
?
570 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
ID: 37793838
What is the code you have ?

And what about just one space ?

mx
0
 

Author Comment

by:terpsichore
ID: 37793846
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
ID: 37793855
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
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 50

Expert Comment

by:Martin Liss
ID: 37793870
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
ID: 37793871
not sure I follow you... what is "selRTF"?
0
 
LVL 50

Expert Comment

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

Author Comment

by:terpsichore
ID: 37793887
I'm using Access 2010, it says that property is not available.
0
 
LVL 50

Expert Comment

by:Martin Liss
ID: 37793891
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
ID: 37793931
I found the answer: use the PLAINTEXT function - this solves it perfectly.
0
 

Author Closing Comment

by:terpsichore
ID: 37815445
this function is exactly what I was looking for.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

850 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