This is probably very simple but after working on it for a couple hours I'm stumped.
My UserForm has a Delete button that brings up a confirmation before you delete the record. If you say "yes" the record is deleted as intended. If you say no the form closes without deleting as intended.
I need to add a confirmation that follows a "No" click that says that nothing was deleted...and I don't want the currently displayed data to reset.
My UserForm has a Delete button that brings up a confirmation before you delete the record. If you say "yes" the record is deleted as intended. If you say no the form closes without deleting as intended.
I need to add a confirmation that follows a "No" click that says that nothing was deleted...and I don't want the currently displayed data to reset.
VBA Code:
Private Sub cmdDeleteSub_Click()
Dim CurrentRow As Long
Dim Answer As VbMsgBoxResult
CurrentRow = i
Answer = MsgBox("Are you sure you want to delete this Subdivision completely? There is no undo", vbYesNo + vbQuestion, "Delete Record?")
If Answer = vbYes Then wsDataCenter.Cells(CurrentRow, 1).EntireRow.Delete
With Me
.SubName.Clear
.SubCode.Value = ""
.SubInitials.Value = ""
.FieldManager.Clear
End With
MsgBox ("Subdivision Successfully Deleted!")
Call UserForm_Initialize
End Sub