Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form_Delete ignored at second hit on 'Delete'

Status
Not open for further replies.

snerting

Programmer
Oct 20, 2005
52
Hi!

Deleting rows in my app is not supposed to actually delete a row in the table, but rather set a field to "1" thus describing the row as deleted.

To make this work, and at the same time granting people the possibility to hit "delete" on rows, I have implemented the Form_Delete event and set Cancel = True. Now, this works perfectly the first time you hit "Delete" on any given row. The problem, though, emerge when you hit "Delete" more than one time. Other than the first time, I can't even have the code break on "Form_Delete", even though I set a breakpoint on the method itself. This is obviously a problem as my routine of setting a field to 1 instead of actually deleting the row is ignored, and the row is actually deleted.

Using MS Access 2003 with VB6.
 
Yes, but it suddenly stopped ignoring Form_Delete, so I don't really understand what was wrong, as I can't really see that I made changes which should impact this at all.

Guess I'll come back and complain some more if the problem resurfaces.
 
If you really want triggers, stop using access as backend but a real database engine.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I'm using oracle as the backend, using access for some legacy applications. Didn't have the possibility to use delete-triggers in this case as different code frameworks accessing the database would have to be rewritten.
 
Using access security you may disallow delete ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top