determining if current position is on deleted record

  • Thread starter Thread starter astro
  • Start date Start date
A

astro

I have some code in the on_current event of a bounded form. The on_current
event fires off when a record is deleted and the cursor position is still on
the deleted record. Is there an equivalent to "me.form.NewRecord" that I
can determine if a delete is active in the on_current event?

Thanks
 
I believe you're not understanding what is really going on...when a record
is deleted, you are moved to the next record and hence Form_Current fires.
The move to the next record is what cause Form_Current to fire...not the
delete, although the delete IS the cause for you moving to another record.
 
on_current fires before the move to the adjacent record - so the status of
the current record is #deleted#...

is this not correct?
 
No...OnCurrent fires when the current record changes to a different record.
The delete causes a move to another record first, THEN the record is
deleted.

Test for yourself....create a table and related form, insert several
records, and then put some code in Current event with a msgbox to give you
the ID for the current record, then delete a record....it will never error
or show #deleted#...it will always give you the ID for the record FOLLOWING
the one you delete (or in case of moving to new record, an error).

If this still isn't clear, post your code.
 
ok - I believe you ))

Paul Overway said:
No...OnCurrent fires when the current record changes to a different
record. The delete causes a move to another record first, THEN the record
is deleted.

Test for yourself....create a table and related form, insert several
records, and then put some code in Current event with a msgbox to give you
the ID for the current record, then delete a record....it will never error
or show #deleted#...it will always give you the ID for the record
FOLLOWING the one you delete (or in case of moving to new record, an
error).

If this still isn't clear, post your code.
 
Back
Top