open database testdata create SQL view vCustomer as ; select *, 0x80000000-RECNO() AS rcorder FROM testdata!customer close databases allThen in your form create a grid from this view (say grdVcustomer), set KeyPreview to .t.
*Form.init Select vcustomer CursorSetProp("Buffering",3,'vCustomer') Index On rcorder tag myOrder CursorSetProp("Buffering",5,'vCustomer') && Just assumed you want to use table buffering * Form.Keypress Lparameters nKeyCode, nShiftAltCtrl Local ix If nKeyCode = 145 And nShiftAltCtrl = 2 and ; Type('this.ActiveControl')='O' and ; Compobj(this.ActiveControl, this.grdVcustomer) DoDefault() Nodefault Insert Into vcustomer (rcorder) Values (0x80000000-(Reccount()+1)) Locate With This.grdVcustomer .Refresh For ix = 1 To .ColumnCount If .Columns(m.ix).ColumnOrder = 1 .Columns(m.ix).SetFocus() Exit Endif Endfor Endwith EndifCetin