The way I do this is make the response from the message a variable and then do my IF statement. See below my changes.
Private Sub cmdDeleteRec_Click()
On Error GoTo Err_cmdDeleteRec_Click
Dim response as integer
DoCmd.SetWarnings False
response = MsgBox("Are you sure you want to delete...