Lesbans RTF2 control - disappearing text

  • Thread starter Thread starter medirate
  • Start date Start date
M

medirate

I am using the RTF2 control on a subform. If the user navigates from the
main form to the subform, clicks a field, then enters or tabs over to the
RTF control, the control works fine. However, if the user goes from the main
form directly to the RTF control, then the cursor remains in place and any
text the user types will not appear.

The same thing happens when the user leaves the RTF control...if he clicks a
field in the subform, then goes into the main form, any text typed will
appear. But if he goes directly from the RTF control to the main form, the
text entered in any field of the main form will not appear.

It's as if the subform has to be "activated" prior to entering or leaving
the RTF control in order for the cursor not to be locked in place.

Note: I have 2 RTF controls on the subform named rtf2control1 and
rtf2control2. Both have memo fields as a control source. Using Access 2002,
and the control appears to have installed properly.

Any suggestions?

Thanks,
medirate
 
The issue is with Access as a host OLE container, subforms and focus. Access
does not support ActiveX controls in a subform configuration. Yes I know
many controls work on a Subform but there are issues as you have discovered.
The relevant point here is that a Subform is not always a true window,
specifically when it no longer has the focus.

There is no easy workaround other than to place the RTF controls directly on
the parent form.

If I had to code a solution for a control on Subform you would need to
control the entry and exit to and from the control. In one of the RTF
control's Focus events I would check and see if the Screen.PreviousControl
belonged to the Subform or not. If not then set focus to a control on the
subform and then immediately back to the RTF control. Follow the same logic
when the RTF control loses the focus. I have not tested this logic but it
should work in one form or another.

--

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

I didn't realize that about some ActiveX controls. I used the control's
focus event to automatically open up a new form with the control on it, and
it works like a charm.

medirate
 

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

Back
Top