bruce@aristotle.net wrote:[color=blue]
> Hello,
>
> I am trying to figure out how to use a class with a custom event as a
> wrapper for a subform so that I can automatically trigger things to
> happen on the parent form when the custom event is raised. I am new to
> custom events, so please bear with me...
>
> I have created a class module (clsMyEvent) as follows:
>
> Option Compare Database
> Option Explicit
>
> Private WithEvents mcmd As CommandButton
> Public Event MyEvent()
>
> Public Property Set ActionButton(cmd As CommandButton)
>
> Set mcmd = cmd
>
> End Property
>
> Private Sub mcmd_Click()
>
> RaiseEvent MyEvent
>
> End Sub
>
> I then created a form with a single command button on it (cmdRaise) and
> set its HasModule property to False. I then created a second form and
> embedded the first form in it as a subform and named the subform
> 'fsub'. Then I added the following code to the second form:[/color]
Setting the HasModule property of the subform to false is why the event
isn't firing. Change that and your code should work.