
calling a sub inside a usercontrol from a module
Declare a public variable in your standard module like this:
Dim MyCtl as MyCtlName 'Replace MyCtlName with whatever your userControl is
Then, in your UserControl_Initialize event, do this:
Set MyCtl = Me
Then, whenever you want to call a function of your usercontrol from your
standard module, just call
MyCtl.MyFunction 'replace MyFunction with whatever the function is
For a great example of a subclass control (no cost) check out
WWW.SOFTCIRCUITS.COM
Good Luck,
Russell Davis
Quote:
>Im working on a ocx, it uses subclass. since you can't call the events from
>a standar module so i put a friend sub inside the usercontrol to do the
>trick but hte problem is that I can't call the sub from the module, how can
>I do this?
>thanks