Yashodhan, try this - instead of using KEYBOARD() function just call the forms KEYPRESS event directly using THISFORM.KeyPress( nKeyCode, nShiftAltCtrl ). Then return should follow to the next line when the keypress event finishes. (But then again if you know its going to be the F2 key then just invoke the lookup routines directly and bypass KEYPRESS :)
>Hi Everybody,
>In the click event of the commandbutton, I have following code –
>
>KEYBOARD '{F2}'
>THISFORM.oLastObject.SETFOCUS()
>THISFORM.oLastObject = NULL
>
>F2 is trapped in the keypress event, which triggers the lookup. After coming back from the lookup I want to set the reference of the last object to NULL, but the execution does not wait for the first line to finish (like FPD 2.6), and I loose the reference of the last object before going to the lookup. How can I overcome this problem?
>
>Regard,
>Yashodhan
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.