Add Events

S

sarndt

If you have a set of control toolbar objects on a worksheet at design time
that you've created events for in a worksheet module collection and use in a
class module, and you add objects at run time to the worksheet, how do you
add events for the new objects to the collection? And is there anything else
you need to do to recognize the new object events

Thanks

Steve
 
V

vanderghast

There is few need to add an event if you are the owner of the two sides of
the code (the one raising the event and the one consuming it). Instead of
raising the event, call the procedure you wish to be executed: in response
to a click on your button, in the button_click event (form Microsoft), don't
raise an event of your own, call the intended method, directly. Events are
great if there are two different owners of the code, like for a button click
event, there is Microsoft, raising the event, and you, consuming it with an
handler.

Hoping it makes sense,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top