if pemstatus(thisform, "CustomKeyPress",5) && Method exists thisform.CustomKeyPress(m.nKeyCode,this.parent) endifIn the form class you can add CustomKeyPress method
lparameters nKeyCode, toObject * nKeyCode - code of the key pressed * toObject - column object reference ** Now you may do your procedures>I just tested your code and it works fine opening another form when the user presses F12. Do you by any chance have any key assignments for F12 in your code using ON KEY LABEL or perhaps an F12 Shortcut on your menu that may be overriding it? I also tested it with a F12 hotkey assignment in my menu and the menu's key assignment ran instead of the code in the keypress event of the textbox in the grid.
>> if Nkeycode=134 >>do form forms\custlist >> endif >>>>
>>* Grid InitEvent Code >>FOR EACH oColumn IN this.Columns >> WITH oColumn >> .RemoveObject('Text1') >> .NewObject('text1','GrdAddNew','sdbgrid.vcx') >> .CurrentControl='Text1' >> .text1.visible=.t. >> ENDWITH >>ENDFOR >>>>
>>* GrdAddnew textbox class KeyPressEvent Code >>LOCAL lcAlias >> lcAlias = THIS.PARENT.PARENT.RECORDSOURCE >> DO CASE >> CASE nKeyCode = 24 && '{DNARROW}' >> * 3 Field in an appended record has not been >> * edited or deletion status has not changed for >> * the appended record. >> IF GETFLDSTATE(-1) = REPLICATE("3",FCOUNT(lcAlias)+1) >> NODEFAULT >> ENDIF >> CASE nKeyCode = 5 && '{UPARROW}' >> IF GETFLDSTATE(-1) = REPLICATE("3",FCOUNT(lcAlias)+1) >> TABLEREVERT(.F., lcAlias) >> THIS.PARENT.PARENT.REFRESH >> ENDIF >> ENDCASE >> >>