Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using views to populate list box with multiple records
Message
De
29/01/1999 14:26:26
 
 
À
29/01/1999 14:17:04
Noman Aftab
Embry-Riddle Aeronautical University
Daytona Beach, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00181943
Message ID:
00181946
Vues:
9
>HI everyone!
>Let me thank everyone for helping me out.
>I have another question here, this time about using views. Can anyone tell me if it is better to create local views and then populate list boxes with multiple records by putting a filter on the parent record.
>Here is the code which I am using in refresh procedure of the listbox:
>
>cparentTable = Alias()
>* selects the view
>SELECT zoneview
>* sets filter on wcdet.wcnumber<-- which is a field from parent table
>SET FILTER TO ALLTRIM(wcdet.wcnumber) = ALLTRIM(zoneview.wcnumber)
>
>* Populating list box with relevent field values
>Rowsource = 'zoneview.zone'
>Rowsourcetype = 6
>
>SELECT (cparentTable)
>
>OR, what if I put SQL SELECT Statements in the refresh() for each list box and try to retrieve this data.
>
>Also, how should I manipulate the data in a view by using a mover lists.
>
>Please advise me as what do I need to do from here on.
>THANKS!

Firstly, that's not a good idea to populate listbox from Refresh method, just because this code will be fired too often, more often then it's really needed to re-populate the list. If list content supposed to be stable then you populate it from its Init event, if some other control will require repopulating the list then this control interactivechange event is another good place.
Secondly, filters are generally not the best thing in VFP. You may better use p-view or cursor as listbox rowsource. BTW, if number of items is really few, you can even fill list using Add(List)Item: this is the simplest possible setting.
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform