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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't get Access to give me a delete confirm message! 1

Status
Not open for further replies.

beverlee

Instructor
Oct 8, 2002
61
US
I can't seem to get Access to give me a delete confirmation message when I choose to delete through my form. If I go to the table and delete, I get the message. I don't have any code to turn warnings off and I have the Confirm Record Changes checked in my Options on both the front end and the back end. I've also tried to produce a message box with the BeforeDelConfirm event but nothing happens. I don't want to turn delete capabilities off completely, but definitely want to warn my users before they delete something that they don't intend to. Any ideas? Thanks!
 
How bout trying this on the On Delete Event:

Private Sub Form_Delete(Cancel As Integer)
Cancel = (MsgBox("Are you sure you want to delete this record?", vbQuestion + vbYesNo + vbDefaultButton2, "Confirm") = vbNo)

End Sub
 
That was easy! Thanks! Don't know why I didn't try that to begin with!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top