My technique is to put something like
debug.print "formname", "eventname", now()
in each of the form and any subforms open, load and current events (whether they have any code or not). Data gets loaded in the load event and subforms get opened before the main form - and the current event can be called many times - for example a main form with 2 subforms will execute the open, load and current events for the first subform and repeat the current event twice more, once when the second subform opens and again when the main form opens. Not sure but I think listboxes and combos are populated in the open event
If you want to create a general function you can use something this
Code:
Function WhatWhen(fName as string, eName as string)
static pTime as date
dim t as date
t=now()
if isnull(pTime) then 'this is the first call so set the prior time
ptime=t
debug.print "Initial event starting with ", fName, eName
else
debug.print fName, eName, t, t-pTime
ptime=t
end if
End Function
call this event once at the beginning of any code in the event you believe is the first to execute and again at the end then just at the end for all other events