• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 376
  • Last Modified:

RaiseEvent Question

I am creating a form from another form by doing the following:
-------------------------------------
Private WithEvents newForm as Form
Set newform = New form_myForm
-------------------------------------


Then in my form_myform that is getting instanced it has the following:
-------------------------------------
Public Event myEvent
...
...
...
RaiseEvent myEvent
-------------------------------------

But my form that created the instance only sees the intrinsic events associated with the Form object not those that i have declared in form_myForm.

So if youhave any suggestions to how I could make my calling form receive events raised in the instanced form that would be great.
0
sp3317
Asked:
sp3317
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
In the Object List on your first form code editor, you should see "NewForm". Once choosen, you should see your event (and not the intrinsic events).

Also, your declaration must be done this way:
Private WithEvents newForm as form_myForm
0
 
sp3317Author Commented:
Can't belive i missed that one. Thanks for the help!

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now