>Public oForm >oForm = Createobject('myForm') >oForm.Show > >Define Class myForm As Form >DataSession = 2 >Top = 0 >Left = 0 >Height = 400 >Width = 750 >Caption = "Search Test" > >Add Object lblSearch As Label With ; >Left = 5, Top = 5,Width=60,Caption='Company' >Add Object txtSearch As TextBox With ; >Left = 70, Top = 5, autocomplete = 1 &&&& i tried adding this without success!! >Add Object myGrid As Grid With ; >Height = 300, Width = 750, Top=30 > Procedure Load > If Used("customer") > Use In customer > Endif > **** Do not need to do this if there is an Index > Set Exclusive On > ************************************************ > Select 0 > Use Home()+"samples\data\customer.dbf" > ************************************************ > Index On company Tag company > Set Order To Tag company > ************************************************ > Endproc >Procedure Init >With This.myGrid >.RecordSourceType=4 >.RecordSource = "select * from customer "+; >" where UPPER(company) = UPPER(TRIM(thisform.txtSearch.Value))"+; >" into cursor crsCustomer" >Endwith >Endproc > >Procedure txtSearch.Interactivechange >With This.Parent.myGrid >.RecordSource = .RecordSource >Endwith >Endproc >Enddefine > >>
>>Public oForm >>oForm = Createobject('myForm') >>oForm.Show >> >>Define Class myForm As Form >>DataSession = 2 >>Top = 0 >>Left = 0 >>Height = 400 >>Width = 750 >>Caption = "Search Test" >> >>Add Object lblSearch As Label With ; >>Left = 5, Top = 5,Width=60,Caption='Company' >>Add Object txtSearch As TextBox With ; >>Left = 70, Top = 5 >>txtSearch.autocomplete = 1 &&&& i tried adding this without success!! >>Add Object myGrid As Grid With ; >>Height = 300, Width = 750, Top=30 >> >>Procedure Init >>With This.myGrid >>.RecordSourceType=4 >>.RecordSource = "select * from customer "+; >>" where UPPER(company) = UPPER(TRIM(thisform.txtSearch.Value))"+; >>" into cursor crsCustomer" >>Endwith >>Endproc >> >>Procedure txtSearch.Interactivechange >>With This.Parent.myGrid >>.RecordSource = .RecordSource >>Endwith >>Endproc >>Enddefine >> >> >> >>***http://www.databaseforum.info/18/1058133.aspx >>>>