KeyPress

kev

Registered User.
Local time
Today, 01:38
Joined
Dec 30, 2000
Messages
13
I'm Looking to get the
esc key to close the form,
and F2 to restore all minimized forms
does anyone have any idea of code needed and where to put it

cheers Kev
 
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.
 

Users who are viewing this thread

Back
Top Bottom