Command buttons are generally accessed via Alt hotkeys. I recommend that you use that type of a combination instead of a function key. In addition, F10 is reserved by Windows to activate the menu.
>Hi ! can any one tell me how to set function key in command button ?
>
>the coding below will works if I set sysmenu off,
>but I need to show my menu on top
>so what should I do ?
>
>
>thisform.keypreview=.t.
>
>thisform.keypress
>do case
>case nkeycode=-9 && F10
> thisform.cmdSave.click
>endcase
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer