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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with requery in on delete event

Status
Not open for further replies.

BitZero

Programmer
Mar 11, 2008
100
US
I have a form with 2 subforms. The first subform is used to update a detail file. The second subform has summary totals of the detail file. Whenever a record is added or changed in the first subform, I do a requery on the second subform to refresh the totals, and this works fine. However, if I try to do the requery on the second subform in the on delete event in the first form, then I get run-time error 3246 - "Operation not supported in transactions". The code in the on delete event looks like this:
Code:
Me.Parent!sfm_Dept.Form.Requery
Any ideas on what can be done to get the requery to work after a delete? I'm using Access 2003.
Thanks
 
I tried the "After Del Confirm" event, but it's not firing after I delete a record. The "On Delete" event does get called.

To delete a record, I click on the record and press the Delete key.

 
Tell us more. Test more. Troubleshoot more.

Why do you think the after del confirm is not firing? What other events are similar? Did you try any of this in a new form to make sure something else wasn't running in your form?

Duane
Hook'D on Access
MS Access MVP
 
I found that the "After Del Confirm" event only fires if the "record changes" box is checked on the Tools/Options/Edit-Find/Confirm screen. The requery works in the After Del Confirm event. The requery does not work in the On Delete event, because the record has not yet been deleted when the event is fired.

So all is well. Thanks for your response.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top