
Signature
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com
Another thing to look at (thanks to Alex for steering me in the right
direction last week!) is that the other events for that control must be
coded exactly right. I had exactly the same problem, and it stemmed from a
sub that I typed in according to the description in VB Help for the treeview
control:
Private Sub xtree_KeyDown(KeyCode As Integer, Shift As Integer)
I couldn't for the life of me figure out why that sub wrecked the whole
control and brought on all the messages ("Procedure declaration does not
match event description of event or procedure having the same name") as you
have seen. Alex suggested that I initiate the subs by going to the comboBox
in the upper left of my VB code window, select my control, and then select
the event from the comboBox on the right. VBA started my subroutine thus:
Private Sub xtree_KeyDown(KeyCode As Integer, ByVal Shift As Integer)
Everything had fallen apart because my code didn't match the exact
description as Access wanted to see it. I'm not even sure the technical
reason the "ByVal" keyword needs to be there, but when I put in the ByVal
reference to the Shift parameter, everything works.
The point is not that one can't type in the event subs, but to make sure
they match exactly, it's safest to take it from the IDE.
Look at the events you have written code for, cut out the text, and delete
the sub declaration (and the "End Sub"). Starting with the comboBoxes,
choose the event you want, and paste your code back in between the Private
Sub... declaration and End Sub. You'll probably notice some tiny difference
from the declaration line you deleted.
I hope this helps. My hat's off to Mr. Dybenko for getting me straightened
out on it!
Paul Johnson
> check that you have same OCX file version of both PCs
>
[quoted text clipped - 11 lines]
> >
> > Anyone know what is going on?
Jules - 22 Apr 2004 14:00 GMT
Thx- I'll give give this a try...
>-----Original Message-----
>Another thing to look at (thanks to Alex for steering me in the right
[quoted text clipped - 49 lines]
>
>.
Alex Dybenko - 22 Apr 2004 14:41 GMT
Thanks Paul :-))
> Another thing to look at (thanks to Alex for steering me in the right
> direction last week!) is that the other events for that control must be
[quoted text clipped - 46 lines]
> > >
> > > Anyone know what is going on?