Grid.init >>>>with this >>>> .recordsourcetype = 4 && SQL >>>> .recordsource = "select * from mytable "+; >>>> "where fld1 = trim(thisform.txt1.value) " +; >>>> "and fld2 = trim(thisform.txt2.value) " +; >>>> "and fld3 = trim(thisform.txt3.value) " +; >>>> "into cursor grdCursor" >>>>endwith >>>> >>>>* Lostfocus of textboxes >>>>thisform.mygrid.refreshCetin
oForm = createobject("myForm") oForm.show READ events DEFINE CLASS myform AS form DoCreate = .T. Caption = "Test Form" Name = "myform" ControlBox = .F. Top = 0 Left = 0 Height = 282 Width = 630 ADD OBJECT text1 AS textbox WITH ; Height = 23, ; Left = 7, ; Top = 4, ; Width = 100, ; Name = "Text1" ADD OBJECT text2 AS textbox WITH ; Height = 23, ; Left = 109, ; Top = 4, ; Width = 100, ; Name = "Text2" ADD OBJECT grid1 AS grid WITH ; Height = 200, ; Left = 5, ; Top = 32, ; Width = 609, ; Name = "Grid1" ADD OBJECT mycommandbutton1 AS commandbutton WITH ; Top = 242, ; Left = 522, ; Autosize = .t., ; Cancel = .T., ; Caption = "Close", ; Name = "Commandbutton1" PROCEDURE commandbutton1.Click thisform.release Clear events ENDPROC PROCEDURE grid1.Init this.recordsourcetype = 4 this.recordsource = ; [select * from home()+"samples\data\customer" ]+; [where contact = trim(ThisForm.Text1.value)]+; [into cursor grdCursor] ENDPROC PROCEDURE text1.LostFocus thisform.grid1.refresh ENDPROC ENDDEFINECetin