The Form_Delete event of a subform is whacky. I ran some data checking
in the
Form_Delete of a subform to determine whether to go ahead or cancel the
delete.
The procedure would run twice! If I opened the subform by itself, the
Form_Delete worked fine. I found KB article 295229 which alludes to the
problem
I encountered (setting Cancel to True). I tried the resolution
suggested which
is to bypass Form_Delete and put the code in Form_BeforeDelConfirm, but
it
didn't help me out. I worked around it by putting in a boolean variable
to
avoid displaying messages twice. If anyone has some experience or
advice on
this problem in generic terms, your comments are welcome.
Main form displays the customer and order info.
Main form table:
CUSTOMER_ID
ORDER_ID
etc...
The subform displays all the series (for serial numbers) for the order
and the
range of numbers for this series. Some checking is done to be sure it's
OK to
delete a series range, if not, the delete event is cancelled. A message
box
confirms either the deletion or cancel of deletion. The procedure
executes
twice regardless of cancelling the event or not.
Subform table:
ORDER_ID
SERIES
BEGIN
END
P.S. I reproduced the KB295229 situation and got that error message
twice.