"deekay" <de*****@gmail.com> wrote in
news:11**********************@g49g2000cwa.googlegr oups.com:
A slight correction the form_delete event is being triggered,
however the Form_AfterDelConfirm and Form_BeforeDelConfirm events
are not being triggered even after i tried to use the code in the
documentation.
I never depend on these event firing, because, as Tom says,
user-configurable options can cause them to never fire.
For deletions, I set the form so that AllowDeletions is off, and
have a dedicated DELETE RECORD button. That way I can control the
process myself.
I actually started doing that before I knew about the fact that the
global option caused the events not to fire, because I hated needing
to cache information about the record being deleted so that I could
supply a meaningful deletion message. What I mean by that is that,
by the time the Delete event happens, the record is gone, so you can
no longer collect data from the record to identify it in the
messagbox you pop up asking for confirmation. This is important,
because the displayed record at that point is *not* the one you're
deleting, but the one after it.
Because of that, I consider it crucial to have the confirm message
identify the record, and that could only be done by storing the
needed values in variables in the OnCurrent event (which also meant
you needed to have variables for the current record and for the
previous record, since by the time the delete event fires, a new
record is current).
With a custom command button, you can control the order of events,
presenting the confirmation message before the record is actually
deleted, so that you don't have to cache information about the
record.
--
David W. Fenton
http://www.bway.net/~dfenton
dfenton at bway dot net
http://www.bway.net/~dfassoc