delete event occurs twice

teel73

Registered User.
Local time
Today, 02:30
Joined
Jun 26, 2007
Messages
205
Can anyone explain to me why my delete event displays the confirmation twice? Example:

I have a subform. If I select a record by clicking the record selector, then hit the delete button on my keyboard. I get a message that reads "You are about to delete 1 record. If you click yes ......." ..

So I click "No" ..

Then the exact same message pops up .. "You are about to delete 1 record ......."

So I click "No" again and then thats it. It doesn't delete the record but why does it ask me twice?
 
I created a new form in my test database.
The database has a setting for confirm record changes.
I ticked all the options so that
  • Record changes
  • Document deletions
  • Action queries
are turned on.

When I hit the record selector and hit the delete button, I only get asked once if I want to delete.

Do you have any vba code behind your form or subform that is attached to the 'delete' event, the 'before del confirm' or the 'after del confirm' events?
 
Do you have any code on any of the forms (main or sub)?
 
Yes. I have plenty of code behind the main form. Not any code on the subform's before or afterdelconfirm events though.
 
Post the code you have on the delete event or a delete button, or alternatively comment out the code on the delete event or a delete button and see if you still get the delete msgbox twice.

Check through your code and see if you have any code that asks the user if they wish to delete a record.
 
You could also put a breakpoint on the command button and step through the code
 
You could also put a breakpoint on the command button and step through the code

Exactly, that's what I would do too in order to see what is happening and then it may reveal why it is doing so.
 

Users who are viewing this thread

Back
Top Bottom