Add the code below into the module of the main form and test the behavior:
Code:
Option Compare Database
Option Explicit
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'Code for the main form.
'Sets an event listener to be able to catch the events of the subform 1.
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private WithEvents mSF1 As Form 'Event listener of subform 1.
'
Private Sub Form_Load()
Set mSF1 = Me.mySubForm1.Form 'Point the listener to the form of subform 1.
mSF1.AfterUpdate = "[Event Procedure]" 'Make the event AfterUpdate enabled.
mSF1.AfterDelConfirm = "[Event Procedure]" 'Make the event AfterDelConfirm enabled.
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set mSF1 = Nothing 'Release the event listener.
End Sub
Private Sub mSF1_AfterDelConfirm(Status As Integer)
If Status = acDeleteOK Then
'A record in subform 1 has been deleted.
'Requery the subform 2.
Me.mySubForm2.Requery
End If
End Sub
Private Sub mSF1_AfterUpdate()
'A record in subform 1 has been updated.
'Requery the subform 2.
Me.mySubForm2.Requery
End Sub
I hope it helps,
John