Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
List Box Incremental Search
Message
 
À
12/06/1998 22:17:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00107793
Message ID:
00107798
Vues:
35
>I'm having a problem figuring out how incremental searches work. I have a form with a text box to key in a last name. The form also has a list box with the rowsource type being fields from a table called CLIENTS and the rowsource being clients.lastname, firstname.
>
>As the user keys in the name, I would like the list box to incrementally reflect the entered text.
>
>I have the following code under interactivechange of the textbox:
>
> xname = thisform.txtlastname.value
> seek upper(xname)
> thisform.list1.value = xname
> thisform.refresh
>
>The list will "jump" to the correct item once an entire match is made but not "incrementally". In other words, you have to type Flick before the item with whose last name is Flick is selected. Make any sense?
>
>I have attempted to understand listitemID, indextoitemID, and so on but just can't quite grasp it. There must be an easier way???
>
>Thanks,
>
>Jamie F


Given your rowsource, try to check the bound property is set to 1.

ControlSource property should be table.lastname

The code in textbox interactivechange event should be:

select TABLE
ccode = SUBSTR(ALLT(This.Value),1,LEN('lastname'))
=SEEK(ccode,'table','lastname')
Thisform.Refresh()
JESS S. BANAGA
Project Leader - SDD division
...shifting from VFP to C#.Net

CHARISMA simply means: "Be more concerned about making others feel good about themselves than you are in making them feel good about you."
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform