To be honest, I don't know. We get some weird behavior in Access sometimes
(I posted a message about some of the behaviors earlier). Access also has
some unique behaviors with ActiveX controls. For example, while the control'
s properties are available, you can't get to the control's API without
explicitly using the Object property. Access puts a non-type-specific (as
Object/IDispatch) layer around its embedded controls. So to get to the
control in Access 11, we have to do something like:
Dim visControl as VisOCX.DrawingControl
Set visControl =DrawingControl.Object
At this point, I would chalk up the strange behavior as container-specific.
Sorry not to have anything more concrete,
Mai-lan
--
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Matt said:
Thanks Mai-lan for your comments - but No I'm not working with different
controls/instances. The scenario in Access was(!) at that time:
One Main-form (which is maximized at load time) (myMain)
On that Main-form sat a tab-control (myTab)
On the first page of the tab-control was a sub-form (mygrphForm)
On that subform finally was the drawingControl (myControl)
What confused me was the fact that I always put the code for drawingcontrol
in the subform (mygrphForm) and it worked fine.
But when I tried to get the connectionadded-event to fire it didn't do this
in the subform - only in the Mainform (myMain).
So Peter and I just wanted to learn more about the logic behind that.
Tia
Matt
BTW: Meanwhile I eliminated the subform and placed the drawingcontrol
directly on the tab-control. All the code for it goes now in the Mainform.
Hi, there: Just saw this one. So, I'm a little confused on the scenario.
Do
you have the control on two forms in the same app? One on a main
form
and
the other on a sub-form? If so, the control can be used multiple
times
in
a
single app (like on multiple forms) but it's important to keep in mind
that
it shares an underlying Application object. So for examples, this
can
get
a
little nasty when you're referencing members of a collection like the
Windows collection. We recommend that you index directly into a collection
when working with multiple instances of the control and never do any menu
merging -- the app objects gets pretty confused.
If you are working with multiple instances of the control on different
forms, your event handling issues might be tied to some confusion in the
app
object for who is firing what event. But this is just a wild guess, it's
hard to say for the code snip without full context what's going on. I'm
glad
it is working, though!
Thanks,
Mai-lan
--
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no
rights.
Yes - trial and error is definately eating up most of my time at the
moment...;-))))
Maybe Mai-lan or Senaj are reading this and can shed some light on the
event
handling on different Access-form levels...
Anyway it keeps on firering now and I'm very happy!
Thank you one more time
regards
Matt
Newsbeitrag
Matt
Congratulations!
Because I'm working in Visio 2003 and VB.NET, I dont't have great
experiences with the
DrawingControl. And I don't know your code.
As you can verify in the Editors ListView's on the top-right-side,
there
are only a few Event's noted.
Don't ask me why. Ask the Guru's! We have all to learn ..
In the meantime, I'm faster with Try and Error ... ;-))
Peter