You cannot insert plain text when the control requires RTF encoded text.
Use an Unbound RTF2 control.
In the Current event of the form hosting the RTF2 control do something like:
Me.NameOfUnboundRTF2Control.PlainText =
Me.NameOfYourTextBoxBoundToYourMemoFIeld.Value
Check the PlaintText property name(RTF2 control -Properties and make sure
I spelled it correctly.
If you want to control the RTF Header and Footer you must prepend/append to
your plain text string then see the code/logic in this post:
..
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/micros...orms/browse_fr...
From: Stephen Lebans - view profile
Date: Tues, Feb 14 2006 9:30 pm
Email: "Stephen Lebans"
<ForEmailGotoMy.WebSite.-WWWdotlebansdot...@linvalid.com>
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{\fonttb l{\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.
"robert.waters" <ro***********@gmail.comwrote in message
news:f0**********************************@y21g2000 hsf.googlegroups.com...
Thank you Mr. Lebans. I think I might have figured out why it
wouldn't work.
The RTF control displays nothing at all, but when I print something
like mid(rtfcontrol.value,1,50) to the immediate window, I see the
data.
Do control characters (\t, \n et al) mean anything special in rtf-
speak? They might be suppressing the output...
On Jun 23, 9:33 pm, "Stephen Lebans" <ForEmailGotoMy.WebSite.-
WWWdotlebansdot...@linvalid.comwrote:
There is a 64KB limit when the user interaction with the control is
required. This is an old GDI WIndows limitation linked to the 64KB limit
of
the ScrollBar control.
Other than cutting your data up into manageable chunks, you could use the
RTF control on my site that you mentioned failed. You just have to set the
MaxCharsAllowed property in the Load event of the form containing the
control. I think I maxed this value out at 1000KB.
--
HTH
Stephen Lebanshttp://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"robert.waters" <robert.wat...@gmail.comwrote in message
news:3e**********************************@m44g2000 hsc.googlegroups.com...
I have an Access database frontend linked via ODBC to a large
(gigabytes) mysql database.
I need to view a large amount of data in a a textbox (variable up to
300K), but I receive a 'there isnt enough memory' error whenever I
scroll past N number of bytes in a textbox that has been filled with a
lot of data. I am not sure what N is, but for a large chunk of data
it occurs at about the halfway scroll, and smaller chunks might not
throw the error until scrolling to the very end.
Now, this isn't an issue with system memory; I have 3GBs of RAM in
this machine, and plenty of fast (RAID0) pagefile access. The Access
application does not consume any more memory when the textbox is
scrolled than it did when the textbox was first filled (verified with
sysinternals procexp). It seems like Access is hitting a wall
somewhere.
Is there another textbox-like control that will accept more data? I
have tried Mr. Lebans' rich text box, but was not successful.
Has anyone tried working with large datasets and had a similar
problem? Any solutions?
Thanks in advance,
Robert Waters