Try the KeyPress event procedure.

Private Sub UserForm_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
    If KeyAscii = 27 Then UserForm2.Hide    'ESC key
End Sub