HI
Try this example

Save it as a Prg and DO savedPrg from command window.
*************************************************
CREATE CURSOR test (cName C(20), lCurrent L)
INSERT INTO test (cName, lCurrent) VALUES ("experts",.t.)
INSERT INTO test (cName, lCurrent) VALUES ("Dummy",.t.)
INSERT INTO test (cName, lCurrent) VALUES ("ClayHead",.t.)
INSERT INTO test (cName, lCurrent) VALUES ("WoodBrain",.t.)
INSERT INTO test (cName, lCurrent) VALUES ("IronHead",.t.)
INSERT INTO test (cName, lCurrent) VALUES ("BigHead",.t.)
INSERT INTO test (cName, lCurrent) VALUES ("ShowMan",.t.)
INSERT INTO test (cName, lCurrent) VALUES ("NutHead",.t.)
INSERT INTO test (cName, lCurrent) VALUES ("Ramani",.t.)
INSERT INTO test (cName, lCurrent) VALUES ("Mike",.t.)
INSERT INTO test (cName, lCurrent) VALUES ("Rick",.t.)
INSERT INTO test (cName, lCurrent) VALUES ("Chris",.t.)
INSERT INTO test (cName, lCurrent) VALUES ("Dsumzz",.t.)
INSERT INTO test (cName, lCurrent) VALUES ("mySelf",.t.)
INDEX ON cName TAG cName
SET ORDER TO 1
LOCATE
** All above is code for a table for our example
****************************************************
myFields = "cName,lCurrent"
DO gsFindForm WITH myFields
=MESSAGEBOX("You have selected :"+ ;
ALLTRIM(cName), 0+16, "Eureka!"

RETURN
**************************************************
PROCEDURE gsFindForm
PARAMETERS tcFields
IF PARAMETERS() < 1
RETURN .f.
ENDIF
PUBLIC oform1
oform1=NEWOBJECT("gsFindForm",'','',tcFields)
oform1.Show
RELEASE oForm1
RETURN
**************************************************
*-- Form: gsFindForm
*-- ParentClass: form
*-- BaseClass: form
*
DEFINE CLASS gsFindForm AS form
AutoCenter = .t.
Height = 242
Width = 420
DoCreate = .T.
Caption = "FindForm"
Name = "gsFindForm"
ShowTips = .t.
WindowType = 1
inrecno = 0
cFilter = ""
cFilterOld = ""
ADD OBJECT label1 AS Label WITH ;
Left = 12, ;
Top = 196, ;
Width = 78, ;
Caption = "Search For", ;
Name = "Label1"
ADD OBJECT text1 AS textbox WITH ;
Height = 23, ;
Left = 84, ;
Top = 192, ;
Width = 400, ;
Name = "Text1", ;
ToolTipText = "Case sensitive.. " + ;
"Start with * and learn how it searches"
ADD OBJECT cmdfirst AS commandbutton WITH ;
Top = 216, ;
Left = 0, ;
Height = 27, ;
Width = 84, ;
Caption = "\<First", ;
Name = "cmdFirst"
ADD OBJECT cmdprevious AS commandbutton WITH ;
Top = 216, ;
Left = 84, ;
Height = 27, ;
Width = 84, ;
Caption = "\<Previous", ;
Name = "cmdPrevious"
ADD OBJECT cmdnext AS commandbutton WITH ;
Top = 216, ;
Left = 168, ;
Height = 27, ;
Width = 84, ;
Caption = "\<Next", ;
Name = "cmdNext"
ADD OBJECT cmdlast AS commandbutton WITH ;
Top = 216, ;
Left = 252, ;
Height = 27, ;
Width = 84, ;
Caption = "\<Last", ;
Name = "cmdLast"
ADD OBJECT cmdexit AS commandbutton WITH ;
Top = 216, ;
Left = 336, ;
Height = 27, ;
Width = 84, ;
Cancel = .T., ;
Caption = "E\<xit", ;
Name = "cmdExit"
ADD OBJECT grid1 AS grid WITH ;
Height = 192, ;
Left = 0, ;
Top = 0, ;
Width = 420, ;
Name = "Grid1"
DeleteMark = .F.
HighlightRow = .T.
ReadOnly = .T.
ForeColor = RGB(0,0,0)
BackColor = RGB(255,255,192)
GridLineColor = RGB(0,0,128)
PROCEDURE Init
PARAMETERS tcFields
IF PARAMETERS() < 1
RETURN .f.
ENDIF
LOCAL nCount
nCount = ALINES(laFields,tcFields,","

WITH ThisForm.Grid1
.ColumnCount = nCount
** just added for checkbox example..
** The checkBox is added as Text1
** ... to avoid an error in AfterRowCol Change event
.Visible = .f.
WITH .Column2
.RemoveObject("Text1"

.AddObject("Text1","CheckBox"

.Sparse = .f.
ENDWITH
.Visible = .t.
**
FOR I=1 TO nCount
.Columns(I).ControlSource = laFields(i)
ENDFOR
.SetFocus()
ENDWITH
ENDPROC
PROCEDURE cmdfirst.Click
GO TOP
ThisForm.Grid1.SetFocus()
ThisForm.Refresh()
ENDPROC
PROCEDURE cmdprevious.Click
IF NOT BOF()
SKIP -1
ENDIF
ThisForm.Grid1.SetFocus()
ThisForm.Refresh()
ENDPROC
PROCEDURE cmdnext.Click
IF NOT EOF()
SKIP
ENDIF
ThisForm.Grid1.SetFocus()
ThisForm.Refresh()
ENDPROC
PROCEDURE cmdlast.Click
GO BOTTOM
ThisForm.Grid1.SetFocus()
ThisForm.Refresh()
ENDPROC
PROCEDURE cmdexit.Click
ThisForm.Release()
ENDPROC
PROCEDURE Text1.INTERACTIVECHANGE
LOCAL cFilterOld, cFilterIn
cFilterOld = ThisForm.cFilterOld
cFilterIn = KEY()
SET FILTER TO
IF LEFT(This.Value,1) = "*"
IF LEN(ALLTRIM(This.Value)) > 1
ThisForm.cFilter = ;
RIGHT(ALLTRIM(This.Value), ;
LEN(ALLTRIM(This.Value))-1)
IF EMPTY(cFilterOld)
SET FILTER TO ThisForm.cFilter $ &cFilterIn
ELSE
SET FILTER TO &cFilterOld .AND. ;
ThisForm.cFilter $ &cFilterIn
ENDIF
LOCATE
ELSE
IF !EMPTY(cFilterOld)
SET FILTER TO &cFilterOld
ENDIF
ENDIF
ELSE
IF !EMPTY(cFilterOld)
SET FILTER TO &cFilterOld
ENDIF
SEEK ALLT(This.Value)
ENDIF
ThisForm.Grid1.SetFocus
ThisForm.Text1.SetFocus
ThisForm.Refresh()
ENDPROC
PROCEDURE Grid1.AfterRowColChange
LPARAMETERS nColIndex
ThisForm.inRecNo = IIF(EOF() OR BOF(),0,RECNO())
This.Columns(This.ActiveColumn).Text1.BackColor = ;
RGB(255,0,0)
This.Columns(This.ActiveColumn).Text1.DisabledBackColor = ;
RGB(32,224,224)
This.Columns(This.ActiveColumn).Text1.DisabledForeColor = RGB(0,0,0)
This.Refresh()
ThisForm.Text1.SetFocus()
RETURN .T.
ENDPROC
PROCEDURE Grid1.Init
WITH This
.SetAll("BackColor", RGB(255,192,192),"Header"

.SetAll("Alignment", 2, "Header"

.SetAll("DynamicBackColor", ;
"IIF(recno(This.RecordSource)= ;
ThisForm.inRecno,RGB(32,224,224), ;
RGB(255,255,192))","COLUMN"

ENDWITH
DODEFAULT()
ENDPROC
ENDDEFINE
*
*-- EndDefine: form1
**************************************************

ramani

(Subramanian.G),FoxAcc, ramani_g@yahoo.com