Help with RTF problem

wallymeister

Registered User.
Local time
Yesterday, 20:10
Joined
May 10, 2011
Messages
30
Calling Access Gurus
Hello again, Long time no see!
I have a table that has a memo field set to RTF that mirrors another field. When a report prints and a certain condition exists I programmatically hide/Unhide the TxtBox controls to Print the RTF when I want to. I have an edit form that when I change chosen records value After_Update fires and concatenates HTML String that formats Memo field accordingly. Works great in the form. But when I enter new data via Append Qry in table I can't find a way to enter it formatted with Rich Text. So I have to go into edit form and do each format manually, etc.

Can anyone suggest a way to accomplish this. I even thought I'd try opening the edit form hidden in background to simulate how I accomplish it in After_Upate of Forms subform (which is where the control is) but I'm getting reference errors that might be related to the form being hidden.

Any direction someone can point me in would be appreciated.

Thanks,
Wally :)
 
You can do it in the query - either direct or if it is a "complicated" formatting by using a UDF.
Direct something like below:
Code:
INSERT INTO YourMemoTable ( AMemoField )
SELECT "<b>" & [TheFieldYouWantToFormatAsMemo] & "</b>" AS SomeName
FROM ATable;
 
Thanks JHB for the reply
My format is a little complex
Like - 123456789 with Font size changing as well.
But I will give this a try.

Cheers
Wally
 
It should not be a problem!
 
Worked like a charm!
Thanks so much.
I knew there had to be a way.

I tried UDF but it wasn't working for some reason. It was better done in Update Query anyway. Makes more sense.

Again, Thank you!
Wally
 
You're welcome, good luck.
 
The actual code entered in Query Design Grid:

Num_Format: IIf([Checks.CheckItemDesc]="BLOWER MOTOR","<font size=2>" & Left([Parts].[PartNum],2) & "</font><font size=3 color=red><strong>" & Mid([Parts].[PartNum],3,2) & "</strong><font size=2 color = black>" & Mid([Parts].[PartNum],5,2) & "<font size=3 color=red><strong>" & Right([Parts].[PartNum],3) & "</strong></font>","")

You set me on the correct path. You are the man!

Wally :)
 

Users who are viewing this thread

Back
Top Bottom