Setting the RTF2 control Properties...

  • Thread starter Thread starter Michael Gould
  • Start date Start date
Use the SetFont prop.

Dim x As RTF2
Dim fnt As New StdFont

Set x = Me!rchtxtCalendar.Object
With fnt
.Name = "arial"
.Size = 14
.Italic = False
.Bold = False
.Strikethrough = False
.Underline = False
End With

set x.Font = fnt


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
In Access 2003? Where would you assign this code set - in a class module?
in one of the control's event handlers?

Nice to know you do look after your product.

Mike
 
The sample code can be placed behind a control in the Form's class
module.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Cool, I will try it...by the way - I found a workaround for the bug that
discards the first character entered in the control.

I put this code in the On Enter event handler for the control at the form
level:

Private Sub RTF2Ctrl_Enter() ' or whatever the control is named on the
form....

If Len(RTF2Ctrl.Value) = 0 Then ' we don't want to wipe existing data, do
we?

RTF2Ctrl.Value = " " ' sets the value of the control to a space ( This
bit might be overkill)
RTF2Ctrl.Value = "" ' erases the contents.

End If

End Sub

Only more testing will determine if it is consistent as it looks.

Thank you again for putting this out - well within my budget!

Cheers!

Mike
 
That bug is documented on my site and the FMS site as well. The solution
is to Dirty the record on the Form's Current event.
:-)
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top