Displaying events and objects

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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.
 
Back
Top