Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One to many listboxes
Message
From
05/03/1998 19:26:00
 
 
To
05/03/1998 08:24:10
Steve Camsell
Windmill Associates
Bath, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00082584
Message ID:
00082855
Views:
31
>>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform