Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with list boxes
Message
De
22/12/2004 13:39:23
 
 
À
22/12/2004 12:29:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows '98
Database:
Visual FoxPro
Divers
Thread ID:
00971491
Message ID:
00971533
Vues:
15
Hello Edgar.

>Hello, i need to use two list boxes both are chained, like this:
>
>list box1:
>fruit
>animals
>colors
>and if the user choose any of the list above in the second list box should appear:
>
>listbox2:(Choose animmals)
>dog
>cow
>bird
>how can i do this if i have to use queries on both?
>Do you have a better idea?

The easiest thing to do is to set up a parameterized view to use as the RowSource of the dependent list where you can get a view of all the fruits, all the animals, or all the colors depending on what is selected in the controlling combo box. Then, You set up the dependent list box as RowSourceType = 6 and select the fields from the paramterized view that you are intersted in. Code like this in the Requery() of the dependent list box (We will assume that the name of the controlling list box is lstMaster and that the view parameter is called vp_type and the aprameterized view is called lv_items):
LOCAL vp_type
vp_type = Thisform.lstMaster.Value
REQUERY( 'lv_items' )
Then, in the valid of the controlling list box (assuming that the dependent list box is named lstItems), you pust this code:
Thisform.lstItems.Requery()
You will need some more code to requery the dependent list in the form's init if it comes up populated with data. But this is the basic idea. You have to put the parameterized view into the form's DE with its NoDataOnLoad property set to .T.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform