Form_Delete event can't fire requery in other form

R

robeito

Hello everybody!!

I have myForm with sfrm1 and sfrm2 embedded (both are in datasheet view)
sfrm1 let me edit, insert and delete records in tbl_1
sfrm2 is read only and shows totals of tbl_1 grouped by different concepts

I want to show the totals updated in sfrm2, I have problems deleting rows in
sfrm1 because the following code in sfrm1 does nothing:
Private Sub Form_Delete(Cancel As Integer)
Forms("myForm").sfrm2.Requery
End Sub

and the following raises "This operation is not supported within transactions"
Private Sub Form_Delete(Cancel As Integer)
Forms("myForm").sfrm2.form.Requery
End Sub

any ideas?
 
J

Jeanette Cunningham

Try it like this:
Put an unbound checkbox called chkDelete on sfrm1.

Private Sub Form_Delete(Cancel As Integer)
Me.chkDelete = True
End Sub

In the after update event for sfrm1 put code like this:
If Me.chkDelete = True Then
Me.Parent.sfrm2.Requery
End If

On the current event for sfrm1, put this code:
Me.chkDelete = False


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top