Rich Text in Memo Field- Question (1 Viewer)

RHubbard

Registered User.
Local time
Yesterday, 23:07
Joined
Dec 25, 2001
Messages
47
The ability to apply rich text formatting to memo fields (in Access 2007/2010) is quite helpful for me, however I wonder if there is a way to apply the same RTF formatting to multiple memo records (all at the same time)?

As it is now, I need to go to each individual record and change the formatting (in this case to a specialized language font that "masks" normal ascii type characters with another character).

While this is possible to accomplish if the table data is displayed via a form with the text control fontname set to the font I use, the data in data-sheet views on subforms (and split forms) still requires line by line edits.

Thanks for help and/or pointers.

Rick
 
Last edited:

Galaxiom

Super Moderator
Staff member
Local time
Today, 13:07
Joined
Jan 20, 2009
Messages
12,852
While formatted rich text is displayed the actual value of the field includes the formtting characters.

Values in rtf fields for a font other than the default look like this.
<div><font face=SomeFontName>YourText</font></div>

Differently formatted sections have separate divisions.

Parse the value held in your field and concatenate the new font name using vba.
I would do it using a function.

Consider storing the field as plain text and applying the function in the Control Source of the textbox rather than storing the formatting information in every record.
 

wallymeister

Registered User.
Local time
Yesterday, 22:07
Joined
May 10, 2011
Messages
30
Thanks Galaxiom for your reply
Question?
Is there a way to use Rich Text Memo fields FORMAT property to automaticaly format the data that is entered or changed along the way.

Here is a more real world situation that I have.
PartNo field holds "HM54ZK001" text. I want Memo field to hold "HM54ZK001"

So my thinking is this... when I change PartNo field in my edit form to say "HM66ZK002", I want to have code in OnChange event to also change data in Memo field while keeping the formatting the same. Could I have some html in format property of memo field or call a function that will use string functions to break it apart and concatenate back together using html code. All of my real world data will always be 2 characters(HM) + 2 characters(54) + 2 characters(ZK) + 3 characters(001).
Is this kind of where you was pointing me?
 

wallymeister

Registered User.
Local time
Yesterday, 22:07
Joined
May 10, 2011
Messages
30
Galaxiom
I don't know what happened here but I thought you were replying to my question but I see now that I got something screwed up. Too many windows open at once I suspect.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 04:07
Joined
Feb 19, 2013
Messages
16,610
Consider storing the field as plain text and applying the function in the Control Source of the textbox rather than storing the formatting information in every record
Not sure you can do this for bound controls where the controlsource is plain text.

Not tested but I think it would work if you have an unbound control with code to assign the value of the field and adding the formatting as part of the assignment - OK for single forms but not continuous forms - and you would need code to apply the formatting anyway so it would only be a small amount of additional code (and additional code to update the field after editing)
 

Users who are viewing this thread

Top Bottom