Hi chris3942,
You will need your Form's KeyPreview property set to yes in order for this to work.
If KeyCode = vbKeyEscape Then
DoCmd.Close acForm, Me.Name
End If
This is only an example, you will have to manipulate it to do exactly what it is you want to do.
Note. Personally, I wouldn't use this method, Esc is handy to undo changes to a record.
Bill