Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
One to many relation on a form
Message
De
01/06/1998 15:23:37
 
 
À
01/06/1998 15:15:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00103741
Message ID:
00103750
Vues:
22
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform