Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display a message when removing and adding entries

Status
Not open for further replies.

usheikh

Programmer
May 16, 2005
25
GB
Is there a way to display a message everytime a user has removed and/or adds an entry to a form? I'm using Access 97
 
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



 
Hi,

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top