>i am using the following statment for gird control
>SELECT medicine,QTY,MRP,RACKNO,BATCHNO,EXPDATE FROM STOCK INTO CURSOR Custs and now i want to set focus to other grid in the form when the user press the enter how will i do this
Could you provide more details?
Is this SQL statement your Grid.RecordSource?
Or, do you want to execute this statement in one grid on pressing Enter and display the result in other grid?
If the focus is currently in one grid and you want to set focus to another grid, then you should do something like this:
lParameter nKeyCode
IF nKeyCode = 13
thisform.Grid2.SetFocus()
ENDIF
You might need to place this code to every column's textbox to be able to set focus from anywhere in the first grid.
However I don't know how is the SQL statement is related to this.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison