Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: kirti bhardwaj
  Where is kirti bhardwaj?
 Chandigarh
 India
 kirti bhardwaj
 To: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 Tags
Subject: RE: Search substring
Thread ID: 267218 Message ID: 268714 # Views: 33 # Ratings: 0
Version: Visual FoxPro 9 Category: Windows Vista and VFP
Date: Wednesday, July 14, 2010 8:29:39 AM         
   


> >
> > No no sir it's not like that.It's just an example. Anyone who is using my software can enter any string whether it may start from right or left or even from center.Where the entered text is matched the focus goes to that record.User may enter 9888 or 34874 or 8234 etc.
> >
> > I had a code for partial search on name user will enter any two character of the name in sequence and the focus move to that record.
> >
> > kirti bhardwaj
>
>
> Then you can use "Locate For value $ column as Samir suggested, perhaps in textbox.InterActiveChange() if you like.
>
>
> hth
> -Stefan
>
>
>
>
>
> LOCAL oForm as Form
> oForm = CREATEOBJECT('TestForm')
> oForm.Show(1)
> RETURN
> 
> DEFINE CLASS TestForm as Form
> 	AutoCenter = .T.
> 	PROCEDURE Load
> 		CREATE CURSOR phones (phoneNo C(30))
> 		INSERT INTO phones VALUES ('9888234874')
> 		INSERT INTO phones VALUES ('6398234874')
> 		INSERT INTO phones VALUES ('6398235555')
> 		GO TOP IN phones
> 	ENDPROC
> 
> 	ADD OBJECT txtSearch as Textbox WITH ;
> 		Left = 100, Top = 10
> 	PROCEDURE txtSearch.InterActiveChange()
> 		LOCAL lcValue, lnSelect
> 		lcValue = TRIM(This.Value)
> 		lnSelect = SELECT(0)
> 		SELECT (Thisform.myGrid.RecordSource)
> 		LOCATE FOR m.lcValue $ phoneNo
> 		IF !FOUND()
> 			?? CHR(7)
> 			GO TOP
> 		ENDIF
> 		SELECT (m.lnSelect)
> 		Thisform.myGrid.Refresh()
> 	ENDPROC
> 
> 	ADD OBJECT myGrid as Grid WITH ;
> 		Left = 10, Top = 50, AllowCellSelection = .F., ;
> 		RecordSource = 'phones'
> ENDDEFINE
> 


Sir thankx for your support now i m able to search mobile no.

kirti bhardwaj

ENTIRE THREAD

Search substring Posted by kirti bhardwaj @ 7/3/2010 10:01:25 AM
RE: Search substring Posted by Stefan Wuebbe @ 7/3/2010 10:17:35 AM
RE: Search substring Posted by kirti bhardwaj @ 7/3/2010 10:56:56 AM
RE: Search substring Posted by Stefan Wuebbe @ 7/3/2010 11:38:51 AM
RE: Search substring Posted by kirti bhardwaj @ 7/14/2010 8:29:39 AM
RE: Search substring Posted by Samir H. @ 7/3/2010 10:18:21 AM
RE: Search substring Posted by Jun Tangunan @ 7/3/2010 1:10:56 PM
RE: Search substring Posted by Samir H. @ 7/3/2010 4:02:01 PM
RE: Search substring Posted by Jun Tangunan @ 7/3/2010 11:54:56 AM
RE: Search substring Posted by Jun Tangunan @ 7/3/2010 12:21:28 PM
RE: Search substring Posted by Nadeem Iqbal @ 7/14/2010 10:01:51 AM