From: Jon Lewis on
Hi All

I'm running into a problem I've not encountered before and was wondering if
anyone else has.
In a split Database after running a standard DoCmd.RunCommand
acCmdDeleteRecord from a command
button in the header of a continuous pop-up form I'm running code in the
Form's AfterDelConfirm Event to requery some dependent subforms on another
open Form.

As you can see below, I'm confirming the Status argument first but it seems
that the subform requeries are sometimes actually happening before the
relevant record has actually been deleted from the table as the relevant
subform
fields end up displaying #Deleted. Sticking in a DoEvents doesn't seem to
make any difference and worse, this is an intermittent problem.

I've also noticed inconsistency with doing something like this before:

Me.AllowDeletions = True
DoCmd.RunCommand acCmdDeleteRecord
Me.AllowDeletions = False

which can fail with the "Delete not available" error as if the
AllowDeletions hadn't actually been set when acCmdDeleteRecord is executed.

Private Sub Form_AfterDelConfirm(Status As Integer)
If Status = acDeleteOK Then
If IsLoaded("frmSite") Then
Forms!frmSite!fsubLastTask.Requery
Forms!frmSite!fsubNextTask.Requery
Forms!frmSite!fsubContact.Form!fsubNextTask.Requery
Forms!frmSite!fSubContactList.Requery
End If
End If
End Sub

Anybody seen this before or have a foolproof resolution (other than running
some sort of check in a Loop before subsequent code execution, which seems
like overkill).

TIA