I have tried to end my program with following procedure:-
1. When i press Escapekey in keyboard it should display messagebox stating 'Do you want to Quit?" with Yes or No Option
Remark: its work up to this.

2. But When i click on Yes button option, It wont work for me. i have used following and it display "compile error: Argument not optional"
Please correct me...

Private Sub Form_KeyPress(KeyAscii As Integer)

If KeyAscii = vbKeyEscape Then
MsgBox ("Do you want to quit"), vbYesNo, "You are clossing your program"
If MsgBox = vbYes Then
End
Else
Me.Show
End If
End If
End Sub

Thank you in advance....