It was right under my nose, wasn't it? It did help!
I adapted the code to my own purposes but this seems to work better than my previous solution since it doesn't have the same issue with the subform transition.
Quick question, if I may:
Code:
If IsNull(Me!frmComboBoxNewDeleteTransferSubform.Form ![TransferDate]) 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 PrimaryKeyValue = " & Me.PrimaryKeyField , dbFailOnError
End If
End If
I changed my SQL statement to
"DELETE * from tblImport;", dbFailOnError
From
"
CurrentDb.Execute "DELETE * FROM tblImport WHERE tblImport.ContractNum = " & Me.ContractNum & ";" , dbFailOnError
As I seem to trigger "error 3061: Too few parameters. Expected 1."
It works fine as the way I changed it, however I am curious as to why the adapted code did not go through.
Any idea why this error triggered?