I have added code to delete a record (and records in related tables)
in the OnClick property:
MsgBox "Confirm delete. Once you confirm, record will no longer
exist.", vbOKCancel
strSQL = "DELETE FROM TOrdAck WHERE OANo=" & Me!OANo
Set dbs = CurrentDb
dbs.Execute strSQL, dbFailOnError
MsgBox dbs.RecordsAffected & " record(s) deleted"
The delete works fine but when you click cancel from the msg box, the
record still gets deleted. I need to be able to cancel the delete
function to save the record.
What needs to be added/changed to my code?