By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,027 Members | 1,261 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,027 IT Pros & Developers. It's quick & easy.

How to clear an ActiveX-Control

P: n/a
Hi,

some time ago Stephen Lebans advised me to 'clear' the RTF2-Control to
prevent some problems with it.

Unfortunately I did not find a way to clear this control before inserting
the RTFText of the next recordset in a report.

Does anyone know how to clear this control or how to clear ActiveX-Controls
in general? The RTF2-Control does not provide a method for doing this - or
maybe I just don't find it.

@Stephen Lebans: Or can you specify how I have to clear the RTF2-Control
between insertions?

Thanks in advance
André
Nov 12 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Andre I thought I already told you how to do this?
Assuming a TextBox control bound to your field named "txtRTFField"
containing the RTF data then in the Detail section's Format event do
something like:

Me.ActiveXCtl36.Object.RTFtext = ""
Me.ActiveXCtl36.Object.RTFtext = Me.txtRTFField.Value

Set the txtRTFField TextBox control's Visible prop to False as you do
not need it visible in the Report. If you are performing AUtosizing of
the RTF2 control then make sure you size it after the above code.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"André Minhorst" <an***@minhorst.com> wrote in message
news:1b******************************@40tude.net.. .
Hi,

some time ago Stephen Lebans advised me to 'clear' the RTF2-Control to
prevent some problems with it.

Unfortunately I did not find a way to clear this control before inserting the RTFText of the next recordset in a report.

Does anyone know how to clear this control or how to clear ActiveX-Controls in general? The RTF2-Control does not provide a method for doing this - or maybe I just don't find it.

@Stephen Lebans: Or can you specify how I have to clear the RTF2-Control between insertions?

Thanks in advance
André


Nov 12 '05 #2

P: n/a
Hi,

Am Fri, 20 Feb 2004 20:57:24 GMT schrieb Stephen Lebans:
Andre I thought I already told you how to do this?
Assuming a TextBox control bound to your field named "txtRTFField"
containing the RTF data then in the Detail section's Format event do
something like:

Me.ActiveXCtl36.Object.RTFtext = ""
Me.ActiveXCtl36.Object.RTFtext = Me.txtRTFField.Value

Set the txtRTFField TextBox control's Visible prop to False as you do
not need it visible in the Report. If you are performing AUtosizing of
the RTF2 control then make sure you size it after the above code.


Stephen, I'm sorry, but I must have missed your answer some time ago.

Well, I already tried to clear the control the way you described it in your
answer, but unfortunately the result is the same.

I also copied each paragraph from the original text in a single recordset
and opened the report just to make sure that the problem is not related to
the headers. The result is still the same.

If you want to, you can have a look at the sample database again:
http://www.access-im-unternehmen.de/...load/RTF00.zip

Thanks
André

--
www.access-im-unternehmen.de
Jeden Werktag ein neuer Know-how-Beitrag!
Mehr als 30 Musterlösungen für Abonnenten!
Nov 12 '05 #3

P: n/a
I just had a quick look at your sample MDB and I do not see where you
are using an Unbound RTF2 control as I suggested. Can you show me an
example with an Unbound RTF2 control?
It's difficult for me to follow your logic/functions as it is written in
a foreign language.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"André Minhorst" <an***@minhorst.com> wrote in message
news:hx*****************************@40tude.net...
Hi,

Am Fri, 20 Feb 2004 20:57:24 GMT schrieb Stephen Lebans:
Andre I thought I already told you how to do this?
Assuming a TextBox control bound to your field named "txtRTFField"
containing the RTF data then in the Detail section's Format event do
something like:

Me.ActiveXCtl36.Object.RTFtext = ""
Me.ActiveXCtl36.Object.RTFtext = Me.txtRTFField.Value

Set the txtRTFField TextBox control's Visible prop to False as you do not need it visible in the Report. If you are performing AUtosizing of the RTF2 control then make sure you size it after the above code.
Stephen, I'm sorry, but I must have missed your answer some time ago.

Well, I already tried to clear the control the way you described it in

your answer, but unfortunately the result is the same.

I also copied each paragraph from the original text in a single recordset and opened the report just to make sure that the problem is not related to the headers. The result is still the same.

If you want to, you can have a look at the sample database again:
http://www.access-im-unternehmen.de/...load/RTF00.zip

Thanks
André

--
www.access-im-unternehmen.de
Jeden Werktag ein neuer Know-how-Beitrag!
Mehr als 30 Musterlösungen für Abonnenten!


Nov 12 '05 #4

P: n/a
Hi,

Am Sat, 21 Feb 2004 07:16:35 GMT schrieb Stephen Lebans:
I just had a quick look at your sample MDB and I do not see where you
are using an Unbound RTF2 control as I suggested. Can you show me an
example with an Unbound RTF2 control?
You're right, I put the wrong version on the server. Here comes the current
version:
http://www.access-im-unternehmen.de/...load/RTF00.zip
It's difficult for me to follow your logic/functions as it is written in
a foreign language.

I translated the the whole thing, excepting example-text.

André

--
www.access-im-unternehmen.de
Jeden Werktag ein neuer Know-how-Beitrag!
Mehr als 30 Musterlösungen für Abonnenten!
Nov 12 '05 #5

P: n/a
Andre thank you very much for taking the time to translate your code to
English. It really helped al ot in the debugging process!
:-)

I cannot find the direct cause of the Bug but I have come up with a
solution.
Place a very tiny Label control anywhere underneath or, at the top or by
the side of the RTF2 control. It does not have to contain any text but
the Visible property must be set to TRUE. Further do not set the Z order
of this control to the BACK of the other controls.

So it appears to be a redraw issue between the Detail section and the
RTF control. I have not see this issue before because all of the sample
Reports, and most normal reports, would have another TextBox or Label
control that is VISIBLE in the Detail section of the Report. Your sample
reports do not have any other controls that are visible in the Detail
section.

ANother solution would be to have a Grouping section above the Detail
section containing any visible control. THis fixes the bug as well.

I really like your code that seperates a document into its consitutent
paragraphs. I would like to get your permission to post this MDB on my
site as I think it would be a very good tool for many people!

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"André Minhorst" <an***@minhorst.com> wrote in message
news:v8****************************@40tude.net...
Hi,

Am Sat, 21 Feb 2004 07:16:35 GMT schrieb Stephen Lebans:
I just had a quick look at your sample MDB and I do not see where you are using an Unbound RTF2 control as I suggested. Can you show me an
example with an Unbound RTF2 control?
You're right, I put the wrong version on the server. Here comes the

current version:
http://www.access-im-unternehmen.de/...load/RTF00.zip
It's difficult for me to follow your logic/functions as it is written in a foreign language.

I translated the the whole thing, excepting example-text.

André

--
www.access-im-unternehmen.de
Jeden Werktag ein neuer Know-how-Beitrag!
Mehr als 30 Musterlösungen für Abonnenten!


Nov 12 '05 #6

P: n/a
Am Sat, 21 Feb 2004 19:44:44 GMT schrieb Stephen Lebans:
Andre thank you very much for taking the time to translate your code to
English. It really helped al ot in the debugging process!
:-)
No problem.
I cannot find the direct cause of the Bug but I have come up with a
solution.
Place a very tiny Label control anywhere underneath or, at the top or by
the side of the RTF2 control. It does not have to contain any text but
the Visible property must be set to TRUE. Further do not set the Z order
of this control to the BACK of the other controls.

So it appears to be a redraw issue between the Detail section and the
RTF control. I have not see this issue before because all of the sample
Reports, and most normal reports, would have another TextBox or Label
control that is VISIBLE in the Detail section of the Report. Your sample
reports do not have any other controls that are visible in the Detail
section.

ANother solution would be to have a Grouping section above the Detail
section containing any visible control. THis fixes the bug as well.
Stephen, thank you very much for having a sharper look at the problem and
for finding a workaround. I spent a lot of time on creating this example
and now it seems to become an interesting solution for doing a lot of tasks
where you normally would use Word.
I really like your code that seperates a document into its consitutent
paragraphs. I would like to get your permission to post this MDB on my
site as I think it would be a very good tool for many people!


No problem. Just give me some time for refactoring some parts of the code,
and I also want to check out what's new in the new version of your control
- maybe there is something interesting for my example. I will send you a
new version as soon as possible.

André
--
www.access-im-unternehmen.de
Jeden Werktag ein neuer Know-how-Beitrag!
Mehr als 30 Musterlösungen für Abonnenten!
Nov 12 '05 #7

P: n/a
I'll look forward to receiving your updated MDB Andre.
:-)

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"André Minhorst" <an***@minhorst.com> wrote in message
news:va****************************@40tude.net...
Am Sat, 21 Feb 2004 19:44:44 GMT schrieb Stephen Lebans:
Andre thank you very much for taking the time to translate your code to English. It really helped al ot in the debugging process!
:-)
No problem.
I cannot find the direct cause of the Bug but I have come up with a
solution.
Place a very tiny Label control anywhere underneath or, at the top or by the side of the RTF2 control. It does not have to contain any text but the Visible property must be set to TRUE. Further do not set the Z order of this control to the BACK of the other controls.

So it appears to be a redraw issue between the Detail section and the RTF control. I have not see this issue before because all of the sample Reports, and most normal reports, would have another TextBox or Label control that is VISIBLE in the Detail section of the Report. Your sample reports do not have any other controls that are visible in the Detail section.

ANother solution would be to have a Grouping section above the Detail section containing any visible control. THis fixes the bug as well.


Stephen, thank you very much for having a sharper look at the problem

and for finding a workaround. I spent a lot of time on creating this example and now it seems to become an interesting solution for doing a lot of tasks where you normally would use Word.
I really like your code that seperates a document into its consitutent paragraphs. I would like to get your permission to post this MDB on my site as I think it would be a very good tool for many people!
No problem. Just give me some time for refactoring some parts of the

code, and I also want to check out what's new in the new version of your control - maybe there is something interesting for my example. I will send you a new version as soon as possible.

André
--
www.access-im-unternehmen.de
Jeden Werktag ein neuer Know-how-Beitrag!
Mehr als 30 Musterlösungen für Abonnenten!


Nov 12 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.