Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One to many relation on a form
Message
From
01/06/1998 15:23:37
 
 
To
01/06/1998 15:15:05
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00103741
Message ID:
00103750
Views:
21
>I have a form on which I'll have two files in the data environment. A book file and an author file. An author is related to the book by an ISBN number. One book can have several authors.
>
>On the title entry form I'd like to show all the authors (lastname) for a particular title (maybe in a listbox). The user would have the ability to add/delete authors.
>
>What is the best way to implement this on a form (listbox?,grid?) How do I only show the authors that belong to that book?
>
>Thanks

You could have a form with two elements: combo and grid. Combo will contain all book titles, i.e. RowSourceType=6 (fields) and RowSource="books.title,isbn". When user will select a title from combo, Combo.InteractiveChange event will fire code:
cIsbn=books.isbn
Select * from authors into cursor curAuthors where authors.isbn=cIsbn

curAuthors is alias you will use as Grid.Recordsource
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform