Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Text1.InteractiveChange Lookup In Table
Message
 
À
25/02/1998 11:51:33
Jeff Tucker
Mackinac Center For Public Policy
Midland, Michigan, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00081082
Message ID:
00081455
Vues:
24
Jeff, probably by now you may have found a solution to your enquiry, but yesterday as I was trying to reply, for some reason my connection to the thread didn't want to work anymore. Anyway, I just finished doing exactly the same thing (incremental or interactive search) using a text box and a grid. Now, rule number one is the SET EXACT must be set to OFF so when you use a seek as in:

In the Form Init method:
SET EXACT OFF
use (mytable) order tag (mydefaultindex)


In the Text box InteractiveChange method code:
=seek(upper(alltrim(this.value))) &&I also had to set the indexes using
thisform.refresh() &&upper(alltrim()) because of the nature of
&&the table I had to use


And the nice thing about this search is that you could have a radio button with several choices (i.e last name, first name, company, etc.) where you simply set your new order and voila! new incremental search on a new field using the same text box.

Have fun,

Gil

>>>I want to be able to type in a text box and as I type dynamically update the contents of a grid to bring me closer to the record for which I am searching.
>>>
>>>I have tried the following and it is not working. I have a textbox, a dropdown list box, and a grid populated by a view.
>>>
>>>The dropdown list box indexes and orders the view.
>>>
>>>Then in the textbox.InteractiveChange event I have the following code:
>>>
>>>SEEK this.value
>>>thisform.refresh
>>>
>>>
>>>After running the form I begin to type in the textbox. It appears that the pointer is being moved to appropriate records but the grid's verticle scroll bar tab shoots to the bottom, and "shakes" every time I type another letter.
>>>
>>>When I press another page on my page frame they are empty. If I click in the grid, the whole form successfully updates to reflect that the pointer has been moved to the record I clicked.
>>>
>>>Any help would be great.
>>
>>Does seek really find a record ? You might need to use something like =seek(trim(this.value),myTable,myIndex).
>>Cetin
>
>Yeah, I think SEEK is what I want here, because it moves the pointer. I am not actually trying to see if record exists, but rather move the pointer ever closer to a record, because each keypress narrows in on the appriate result.
>
>Syntax
>SEEK eExpression
> [ORDER nIndexNumber | IDXIndexFileName
> | [TAG] TagName [OF CDXFileName]
> [ASCENDING | DESCENDING]]
> [IN nWorkArea | cTableAlias]
>Searches a table for the first occurrence of a record whose index key matches a general expression, then moves the record pointer to the matching record.
>
>For instance, if I was to search for the Lastname "Turner". I would use the popup to order by lastname, then I would start typing in the text box. When I type a "T" the desired result would be that the first, alphabetically, record starting with a "T" in the lastname field would appear at the top of my grid and all the other T's would follow underneath. When I type "u" then the first "Tu" record should appear and so on depending on how far I need to go until Turner is visible at which point I would click on Turner and look at other pages in my page frame.
For every bug fixed, there is a bigger bug not yet discovered.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform