If you want to use the same keys throughout your application, you need to use the AutoKeys-Macro (with the AutoExec-Macro all you need to know about Macros).
The technique is as follows:
Write {F2} for the F2-key, {ESC} for escape-key
EXECUTECODE
SubAutokeys("F2")
SubAutokeys("ESC")
Then, write a sub or function "SubAutokeys" in the following style:
Public sub SubAutoKeys(strKey as string)
select case strKey
case "F2"
'Code to Restore your forms
case "ESC"
docmd.close acform,screen.activeform.name
end select
end sub
I think that "{ESC}" represents the ESC-key, but you should verify in the online-help.