In my application i have certain fields that have to be filled or else i consider it as no record.
If so i delete te record(s) programmaticly upon exiting the form with the custom exit button. (there is no way to exit my app any other way).
In my next example i delete the record when two key fields are left blank.
Code:
Dim strSQL As String
'Delete not completed records without a permit from the system
strSQL = "DELETE * FROM Parkingmanagement WHERE (((Parkingmanagement.permit) Is Null))"
DoCmd.RunSQL strSQL
Dim strSQL1 As String
'Delete not completed records without a licenseplate number from the system
strSQL1 = "DELETE * FROM Parkingmanagement WHERE (((Parkingmanagement.LicensePlate) Is Null))"
DoCmd.RunSQL strSQL1