Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
One to many listboxes
Message
De
05/03/1998 19:26:00
 
 
À
05/03/1998 08:24:10
Steve Camsell
Windmill Associates
Bath, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00082584
Message ID:
00082855
Vues:
27
>>I want to have two listboxes on a form with a one to many relationship. I have tried several different ways of doing this and each one has problems or bugs. I'd love to hear from someone who has done this about what you use for the Rowsource for the child listbox and how you set up the one to many relationship.
>
>Hi Peter,
>
>There are lots of ways that you can do this. How about:
>Parent listbox has a RowSourceType of SQL statement, something like
>

>SELECT c.CustomerName, c.CustId
>FROM customer WHERE
>ORDER BY c.CustomerName
>INTO CURSOR curCustomers
>

>The child listbox also has a RowSourceType of SQL statement, something like:
>

>SELECT o.Ord_Item, o.Ord_Date, o.Order_Id
>FROM order o
>WHERE o.Cust_id = curCustomers.Cust_id
>ORDER BY .oOrd_Date
>

>In the InteractiveChange of the Parent listbox, Requery() the child listbox.
>
>HTH

Hi Stve,

This is the method I'm currently using. However when I delete a record that's a member of the child list box and then requery, the query still picks up the deleted record. Today I finally found a workaround for this: I issue a WAIT command for a fraction of a second between the Delete and Requery.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform