Link to home
Start Free TrialLog in
Avatar of Rhydian
Rhydian

asked on

Custom ActiveX Method clash

Hi,

I am developing an ocx in VB6. The ocx has a public method called Requery.

The ocx will be used in a Form in an MSAccess database. There will be a button which when clicked will run the following code...

MyOCXControl.Requery

This should run the public method Requery. It doesn't. This is because MSAccess seems to assign some default methods for custom controls used in it, one of which is Requery. This method seems to override the controls method and obviously does nothing.

Is there any way to override the Requery Method that MSAccess assigns?

Many Thanks in advance.

Cheers,

Rhydian.
Avatar of EDDYKT
EDDYKT
Flag of Canada image

>>MyOCXControl.Requery

>>This should run the public method Requery. It doesn't

If MyOCXControl is your ocx object, then it should run requery function inside that object.
Don't quite sure what you mean
Avatar of Rhydian
Rhydian

ASKER

Let me try and explain...

When you place any third party Activex control into an Access Form/Report, Access exposes some default properties and methods to it (as well as the ones defined within the control), One of these default methods is Requery. This method is in conflict with one I have defined within the control and seems to overrides it.

Try it. Drop any third party control onto a Form and in the code window of the Form type...

me.nameofcontrol.

This will bring up all the properties and methods, one of which is Requery.

Hope this explains the situation and you can help.

Cheers,

Rhydian.
ASKER CERTIFIED SOLUTION
Avatar of Erick37
Erick37
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rhydian

ASKER

Thanks for that.

It does sort of make sense, but for the fact that my control can have a method called Refresh, which is a reserved word and not have the problem I have described!

Renaming the method seems the only solution (at present), but I would rather not do this as my control is an enhanced listbox and I would like to keep the methods and properties the same as the MSAccess listbox, so that I can replace MSAccess listboxes in my applications with the new control without having to amend any application code related to the control. i.e if there is code like...Listbox.Requery I would still like it to run regardless of whether the control is a MSAccess listbox or my control.

Any other ideas?

Cheers,

Rhydian.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rhydian

ASKER

Can I have a refund of the points as no answer given sorts the problem that I am experiencing