When is a delete completed in an APD bound form?


G

Guest

Hi,
I wonder which event to use in order to requery the content of a subform
after the user has deleted a record in another bound listform. I understand
that the order of events is BeforeDeleteConfirm, AfterDeleteConfirm, Delete.
So I put the code in the Delete event but it doesn't work. Probably the
record is not yet deleted because the Delete event has a Cancel parameter.
Using Access 2003 with SQL Server 2000.
TIA,
Norbert
 
Ad

Advertisements

G

giorgio rancati

Hi Norbert,
you are right!
This is the events sequence in ADP.
----
BeforeDelConfirm
AfterDelConfirm
Delete
Current
----

you can requery the subform in Current event.
----
Option Compare Database
Option Explicit

'Flag
Dim Deleted As Boolean

Private Sub Form_Delete(Cancel As Integer)

Deleted = True

End Sub

Private Sub Form_Current()

If Deleted = True Then
Forms("OtherForm").Child1.Form.Requery
Deleted = False
End If

End Sub
 

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