If you delete a record through a form you are asked to confirm the deletion. Isn't that enough?
If you just want to Report the addition then use the AfterInsert event procedure and just put:
msgbox "You have added a new record".
If you want to warn the user BEFORE the record is about to be saved, then you can ask a question in the Form_beforeupdate event procedure.
if not me.newrecord then exit sub
if msgbox ("Confirm add new record?",vbyesno) =vbyes then
' do nothing
else
cancel = true 'stop the save
me.undo ' to undo the new record, if required
end if
Thanks. It works for adding or changing a record. But if I try and use AfterDelConfirm or AfterUpdate events then it doesnt work for deleting the record. Could it be because there is a row selector next to the record on the form because you can usually select a number of rows using the selector and hit the delete key to remove them. I want a Message displayed after a record is deleted using the record selector.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.