What is te best way to handle a situation where someone opens a form to enter data and chooses to cancel this action after entering nothing or has enetred at least some data.
This is what I have tried so far but errors out because delete action is not available.
If MsgBox("Are you sure you want to abandon changes to this record?", vbExclamation + vbYesNo, "LogBook 2002") = vbYes Then
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True
Else 'user clicked no
MsgBox "Deletion was aborted.", vbInformation
End If