@pbaldy
I got a kick out of that one Sean, though I fear including the dbPourAnotherOnError option will create an endless loop.
Yes, that happened to me once. Luckily a friend was around to Ctrl-Alt-Delete me.
@njdaisy86
I might suggest a slightly different approach. When the form is closed, grab the PK value of the current record in the main form (parent table), then check to see if there are any associated records in the child table. More example air code;
Code:
If Not IsNull(Me!PKField) Then
If IsNull(DLookup("ChildTableID","ChildTable","ChildTableID=" & Me!PKField)) Then
If MsgBox("Make sure you enter a Transfer Record." & vbCrLf & "This is MANDATORY." & vbCrLf & "Do you really want to exit?", vbYesNo, "Exit Confirm") = vbNo Then
Me!frmComboBoxNewDeleteTransferSubform.Form![TransferDate].SetFocus
Cancel = True
Else
CurrentDb.Execute "DELETE * FROM tblYourParentTable WHERE PKValue = " & Me!PKField , dbFailOnError
End If
End If
End If