Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Incremental Search

Status
Not open for further replies.

Siddiq

MIS
Sep 23, 2000
46
PK
Dear frieds..

I wan to use incremental search in my application
I have one from and one edit box in my application
how to use incremental search in the application ?

Thnaks and best regards

Siddiq
 
Siddiq

This code is from THISFORM.Text1.KeyPress() event

* SaveAlias() Saves current ALIAS()

lcData = ALLT(THIS.Value)+ CHR(nkeyCode)

SELE TABLENAME && Select Alias()
SET NEAR ON
SEEK UPPE(lcData)
SET NEAR OFF

RELE lcData

THISFORM.Grid1.Refresh()

* RestAlias() Restore old ALIAS()

As you type in .Text1, .Grid1 will show the nearest found record. Make sure you are SEEKing on a indexed field

Hope this helps

Chris
 
Siddiq

Preview not working:-(

As you type in .Text1, .Grid1 will show the nearest found record. Make sure you are SEEKing on a indexed field

Chris

 
Thnks Chris I will follow your advice and as I will
get the result .. I will inform you..
once again thanks..

Siddiq
 
This works but as I change letters i get problems.
As i type the name "wilson"

it jumps from names starting with "w" to names starting with "i" to names starting with "l"
 
Gary

It sounds as though the value you are SEEKing is the CHR(nkeyCode) value and not ALLT(THIS.Value)+ CHR(nkeyCode)

Chris :)
 
Why not try InteractiveKeyChange? then you won't have to worry about the ASCII codes?

No? Ali Koumaiha -:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top