>I use On Key F1 to call a help form. While the user is on the help form I would like to have F1 then run code in a method. I'm getting an error that I must use ThisForm only in a method. I understand that I'm trapping the F1 key at the sytem level and it doesn't understand that there is a form active, but how can I work around this? I can easily put a button on the help form that runs the code I need, but it would be cleaner if the user could just use the F1 key for this secondary help. Thanks!
>
>Regards, Renoir
Renoir,
Because OKL operate outside of the form's context, you need some way of accessing the current form with VFP. You might be able to get an object reference to the form using _Screen.ActiveForm. This is accessable from OKLs.
Or as David suggested, completely do away with OKLs and use the form's KeyPreview/Keypress combination to accomplish it.
HTH.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao