Displaying events and objects

G

Guest

To help debug and understand what events are firing and when in a form with
subforms, I'd like to put some msgbox commands in several events. For
example I want to see "frmMain Form BeforeUpdate" or "frmMain cmdNext Click"
when those events fire. I could hard code that into each event, but I'd
rather write one routine to do that and call it from each event. I stumbled
onto Form.name, but how do I refer to the event?
 
M

Marshall Barton

mlwallin said:
To help debug and understand what events are firing and when in a form with
subforms, I'd like to put some msgbox commands in several events. For
example I want to see "frmMain Form BeforeUpdate" or "frmMain cmdNext Click"
when those events fire. I could hard code that into each event, but I'd
rather write one routine to do that and call it from each event. I stumbled
onto Form.name, but how do I refer to the event?


You can't. Bummer that it is, you can not obtain the name
of a procedure from within the procedure.

The way I like to do the kind of thing you're attempting is
to set the event's ** property** to a function call to your
generic procedure. So, instead of setting the property to
[Event Procedure] set it to
=yourfunction("frmMain Form BeforeUpdate")

If you have some "real" code in an event procedure, then you
will need to call the function from the event porcedure.
 

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