I was given this but it doesn't work...????

Set KeyPreview = true

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If (KeyCode = 27) Then Unload Me
End Sub