With a fairly simple form that's connected to a recordset I added a Delete This Record button using the wizard. I tacked on a bit of additional code to delete some foreign data at the same time.
This does indeed work: it deletes the current record and runs the extra code. However, it also automatically creates a new, blank record and, appropriately (but not what I want) runs the form's OnCurrent code.
I can't figure out what to do to stop it from generating the new record after delete. I've set the Cycle to Current Record, thinking that might be related, but no. I've created a flag that prevents any code from running in the OnCurrent (besides checking for the flag) if a delete was just completed, but no.
It seems likely that this is a very simple thing to fix, but I've thwacked my head on it for a number of hours and figured I'd best turn to folks whose brains aren't mush. Any thoughts?
This does indeed work: it deletes the current record and runs the extra code. However, it also automatically creates a new, blank record and, appropriately (but not what I want) runs the form's OnCurrent code.
I can't figure out what to do to stop it from generating the new record after delete. I've set the Cycle to Current Record, thinking that might be related, but no. I've created a flag that prevents any code from running in the OnCurrent (besides checking for the flag) if a delete was just completed, but no.
It seems likely that this is a very simple thing to fix, but I've thwacked my head on it for a number of hours and figured I'd best turn to folks whose brains aren't mush. Any thoughts?