473,326 Members | 2,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to clear an ActiveX-Control

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
7 2939
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: AnalogKid | last post by:
Short question: What's the difference between SingleUse and MultiUse ? Long question: I've been writing some sample code to see how different Instancing values and threading models work. I...
7
by: NewbieJon | last post by:
I am attempting to send the variable "sComputerName" from my ActiveX script to "GetInfo.asp" using javascript. (Having been advised this is the way to get my ActiveX variable into my ASP script) ...
3
by: Matik | last post by:
Hello everyone, I was wondering. Is it possible, to recive an event from ActiveX into database? I was looking alredy with notification services, but I think that's the wrong way. Lets say,...
5
by: David | last post by:
Hi everyone, I have a ActiveX EXE component written in VB6. This ActiveX EXE exposes various public methods that can be called by several other independent Windows EXE applications (also written...
0
by: Sorin | last post by:
Hi all I have a .NET application that is using few ActiveX DLL wrote in VB6. I managed to get the most from my previous VB6 controls by using them in .NET but sometimes when I am using my...
18
by: DartmanX | last post by:
Is there a simple way to determine if someone using Internet Explorer has completely disabled ActiveX controls? Jason
1
by: Craig | last post by:
I am having problems getting an ActiveX DLL written in VB6 to call a method in a C# class library component. My C# DLL is called CSharpProject.dll and contains a public class called CSharpClass....
2
by: cn99 | last post by:
Hello, I have develop an ActiveX with Visual C++ 6 And I will call functions on this ActiveX from a javascript. I know how to instantiate the activex object (with the balise <object>). ...
4
by: marcosnogood | last post by:
Hello, I need to dynamically load an activex object because what object to load is based on certain conditions. Also I need to wait for the object to have initialized before moving on. What I...
6
by: libsfan01 | last post by:
Hi all Im trying to use prototype for an xmlhttprequest, but it doesn't seem to be working cross-browser. Is there someway of getting it to be IE6 compatible (active x)? here's my code so...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.