* gotfocus This.BackColor= 8454143 this.SpecialEffect =0 this.tag=this.value *lostfocus This.BackColor= 16777215 This.SpecialEffect = 2 Set Exact On If Seek(Trim(This.Value),'stock','stockid') Thisform.grid1.column3.text1.Value = stock.stockname Thisform.grid1.column4.text1.Value = stock.unit Select (Min(price)+Max(price))/2 As AvgPrice From stockd ; WHERE stockd.stockid=this.value Into Array ArrPrice Thisform.grid1.column9.text1.Value = ArrPrice Thisform.grid1.column9.Refresh Store Thisform.txtDepotid.Value To xdepot lcfor="stockd.stockid=this.value and stockd.depotid=xdepot" Calculate Sum (stockd.entryamount) To entries For &lcfor Calculate Sum (stockd.outgoings) To outs For &lcfor Thisform.txtstockmev.Value= entries - outs Thisform.txtstockmev.Refresh Endif If ! Seek(Trim(This.Value),'stok','skodu') Or Empty(This.Value) Messagebox("Stock ID not found...",16," HATA",3) This.Value =This.Tag This.Refresh This.SetFocus Endif * keypress event Lparameters nKeyCode, nShiftAltCtrl If nKeyCode = 134 &&f12 Do Form Form\stockfind IF ! Lastkey()=27 This.value = stock.stockid Thisform.grid1.column3.text1.Value = stock.stockname Thisform.grid1.column4.text1.Value = stock.unit this.SetFocus this.Refresh Endif Endif