Private Sub cmbDelete_Click() Dim msgResponse As String 'confirm delete Application.ScreenUpdating = False 'get user confirmation msgResponse = MsgBox("Do you really want to delete this record?", _ vbCritical + vbYesNo, "Delete Entry") Select Case msgResponse 'action dependent on response Case vbYes 'c has been selected by Find button Set c = ActiveCell c.EntireRow.Delete 'remove entry by deleting row 'restore form settings With Me .cmbAmend.Enabled = False 'prevent accidental use .cmbDelete.Enabled = False 'prevent accidental use .cmbAdd.Enabled = True 'restore use 'clear form ClearControls End With Case vbNo Exit Sub 'cancelled End Select Application.ScreenUpdating = True End Sub
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
22 Experts available now in Live!