I am using this code for all my forms to prevent empty records in my tables
it seems to work well and I can't find any bugs, however I have 1 form which contains a subform and the subform data is still sent through to the table when the form is closed. any ideas?Code:DoCmd.SetWarnings False If Me.Dirty = True Then If MsgBox("Do you wish to cancel?", vbYesNo, "Delete Confirmation") = vbYes Then DoCmd.RunCommand acCmdDeleteRecord End If End If DoCmd.Close DoCmd.SetWarnings True