Stephan Lebans rich text programme: help with toolbar

C

Christine

If Stephan looks at this, let me first say thank you for
your response to my post of 10 October. (The setup
programme worked fine when I downloaded it again.)

Instead of calling the formatting toolbar on the form's
OnLoad event, I want to display it only when the user
actually needs it. So I have tried adding...
DoCmd.ShowToolbar "RTF2", acToolbarYes
DoCmd.ShowToolbar "RTF2", acToolbarNo
....to the RTF control's OnEnter and OnExit events. These
commands work okay in that they display and hide the
toolbar. However, if you actually click on a command in
the toolbar I get errors such as "Compile error - variable
not defined on formatting such
as "ctlX.ParagraphLineNumbering = rtfArabicNumbers" and
others.

(I imported the two modules modRTF2ToolBar and
clsRTFToolbar, although I'm not sure if the clsRTFToolbar
is required, since everything is commented out. We're
using Access 2003 on Windows XP.)

Thanks,
Christine
Can someone explain what I'm doing wrong?
 
S

Stephen Lebans

If you have inserted the RTF2 ActiveX control onto your Form then the
exposed Constants for this class, including the Public enumerations for
the ParagraphLineNumbering property will be available to the compiler.

Do you have the RTF2 control inserted onto your Form?

--

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

Stephen Lebans

It's included with any of the sample MDB's on the RTF2 Web page.

--

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

ChristineP

Stephen,

Yes, I copied the ActiveX control from your sample database onto my form.
Actually, I have two of the controls on the form, once which gets its Control
Source set to Description, the other to Solution. Each of these "actual"
fields are on the form, but are hidden. Both are named RTF control. The only
other changes I made was to the default font (Arial, 10 pt.)

Could it be that I don't have a Reference set? If true, which one should I
load: there are lots to choose from.

Thanks, as always!
 
S

Stephen Lebans

You must insert a new RTF2 control onto your form not copy it from an
existing form.

--

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

ChristineP

Thanks, Stephen - That works!!!! Next problem, if I may...

I've got the OnOpen event of the form with the RTF control set to disable
editing if the user isn't authorised:
If mCurUser <> CheckProcessOwner Then
Me.AllowEdits = False

This sets every field on the form so they can't be edited, but it doesn't
work for the RTF control, and setting lock and enabled via the properties
window doesn't work either. If any locks or enabling is set, then the field
scrolls wildily up and and down. Hitting ESC doesn't work - I've got to
reboot! Do you know what's happening here?

Christine

If I add "'Me.RTF25.Locked = True" and/or "Me.RTF25.Enabled = False" to the
On Open event, or if I physically lock the field o
 
S

Stephen Lebans

Christine I am glad to answer questions but would prefer one question to
each thread as it has more value this way when searching Google.
Secondly before you ask a question you should learn how to search
GoogleGroups.
Finally, with your issue, an explanation is available here:
http://www.lebans.com/richtext.htm#Why cant I use Accesss Enab
led%20and%20Locked%20properties%20for%20the%20RTF2%20Control.
Why can't I use Access's Enabled and Locked properties for the RTF2
Control.

I spent tens of hours on this issue before I finally across a reference
to this issue on the FMS site. The FMS control does not support the
native Access control Enabled or Locked properties. Instead Enabled and
Locked properties are exposed by the ActiveX control directly. What does
this mean to you. Well, assuming your RTF2 control is named "RTF2" then
to set the Enabled or Locked properties you would use code like:

Me.RTF2.Object.Enabled = False


--

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

ChristineP

Thank you again, Stephen. Sorry for messing up - I very wrongly assumed my
troubles with the control were directly related to the very first problem
with downloading the programme. I've still got an issue so will post it
separately.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top