I copy & paste this code from my previous post. The code works perfectly, however if I select No it will display this error " Run-time error "2501" The RunSQL action was canceled" and I have two option..its either End or Debug. What I want is that. once I click No the run-time error will not appear...help.
Code:Private Sub cmdDelete_Click() sql = "DELETE FROM tblGroup WHERE GroupID = '" & GroupID & "'" DoCmd.RunSQL (sql) lst1.Requery End Sub