Re: RTF Control not displaying data

Tech-Archive recommends: Fix windows errors by optimizing your registry



Any changes you make to the record are saved when you move off the record,
jsut as a normal TextBox control that is bound to a Memo field. What do you
mean it is responding as Read Only?

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


"MWG" <MWG@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7687B72D-1D59-4BF6-845D-CDEB741E4F37@xxxxxxxxxxxxxxxx
One more question...how do I save the font/formatting changes within the
control using the shortcut menus? They're all responding as read-only.
(Please feel free to direct me to a resource. I don't want to keep
bugging
you with little stuff. Although I've looked to find a resource, I may not
have found everything there is.)

I can't thank you enough!
--
Thx in advance!


"MWG" wrote:

Stephen -
Thanks again for your response. Your link was very helpful.
I was wondering if you could answer a few more questions for me...

Is it safe to assume that the easiest way to deal with new records being
added by the user is to add code to prepend/append the rtf tags/params as
the
record is being saved?

Is using/loading the RTF toolbar the only way to allow the user to change
formatting of certain characters within the memo field?

When reporting, should the RTF control and the memo field both be on the
report for the RTF control to work?

(Sorry if these questions are too basic but I very much appreciate the
help)
--
Thx in advance!


"Stephen Lebans" wrote:

Do you currently have RTF formatted text in the Memo field? The RTF2
control
displays formatted/encoded RTF text....not plain text.
I have posted code in the past few months to add the required RTF
encoding
to existing plain text fields.


From: Stephen Lebans - view profile
Date: Thurs, Mar 23 2006 12:38 am
Email: "Stephen Lebans"
<ForEmailGotoMy.WebSite.-WWWdotlebansdot...@xxxxxxxxxxxx>
Groups: comp.databases.ms-access, microsoft.public.access.forms
Not yet ratedRating:
show options


Reply | Reply to Author | Forward | Print | Individual Message |
Show
original | Report Abuse | Find messages by this author


The RTF control can only display RTF encoded text. If you want to
simply
display plain text then wrap your plain text within the required RTF
encoding.

Here's a previous post of mine on a related issue.
http://groups.google.ca/group/microsoft.public.access.forms/browse_fr...


From: Stephen Lebans - view profile
Date: Tues, Feb 14 2006 9:30 pm
Email: "Stephen Lebans"
<ForEmailGotoMy.WebSite.-WWWdotlebansdot...@xxxxxxxxxxxx>
Groups: microsoft.public.access.forms
Not yet ratedRating:
show options


Reply to Author | Forward | Print | Individual Message | Show
original
| Report Abuse | Find messages by this author


Let me know how you make out.


Make sure your Form has:
A TextBox control named txtComment bound to the Comment field(just o
you can
see the RTF encoding)
an RTF2 control bound to the Comment field
A CommandButton named cmdRTF


In your References, make sure the ref to DAO is higher in the list than
ADO.


Place this code behind the Command Button.


Private Sub CmdRTF_Click()
On Error GoTo Err_CmdRTF_Click


Dim sRTFdata As String
Dim sHeader As String
Dim sText As String


sHeader =
"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0
Arial;}}"
sHeader = sHeader & "{\colortbl
;\red0\green0\blue0;}\viewkind4\uc1\pard\cf1\fs24"


' I could have shortened the code but I wanted you(and others I refer
to
this posting) to see what is happening at every step.


With Me.RecordsetClone
' Move to first record
.MoveFirst


' Loop until all records are processed
' This example uses a field named "Comment"
' Note this is the name of the FIELD not the
' name of the TextBox control bound to this field
Do While Not .EOF
.Edit
sText = IIf(IsNull(.Fields("Comment")), "",
.Fields("Comment"))
' See if field is empty
If Len(sText & vbNullString) = 0 Then
sRTFdata = sHeader & "}"
Else
sRTFdata = sHeader & sText & "\par }"
End If


' Save our RTF encoded string back to Comment field
.Fields("Comment") = sRTFdata
.Update
' Move to next record
.MoveNext
Loop


End With


Exit_CmdRTF_Click:
Exit Sub


Err_CmdRTF_Click:
MsgBox Err.Description
Resume Exit_CmdRTF_Click


End Sub



--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


"MWG" <MWG@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3A25D6AD-8CEE-411D-8DFD-9D4B993DAD3B@xxxxxxxxxxxxxxxx
I'm sure it's something silly. I've installed the Lebans RTF
control,
placed
it on a form and set its control source to a field from a table. The
control
is not displaying the data from the field. What am I missing?
--
Thx in advance!





.


Quantcast