Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parent-child file with 2 fields (keys) to link
Message
De
07/11/2010 20:20:17
 
 
À
06/11/2010 05:51:53
Maybelle Tan
Oversea Feeds Corp.
Manila, Philippines
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01488435
Message ID:
01488503
Vues:
47
Maybelle,

If a have a parent file with 2 fields as key (example: Customer Code and Invoice No.), how do I link them to my child file containing the same 2 fields among other fields? Also, how can I use a grid in a form for the child file with this?

Your child table must be indexed on those two fields and SET a RELATION to it from the parent, like so:
USE tblParent IN 0
USE tblChild IN 0

SELECT tblChild
INDEX ON custcode+invno TAG mytag

SELECT tblParent
SET RELATION TO custcode+invno INTO tblChild
As you move along the Parent records, it will automatically point you to the related records in your child.

Use this same setup in your form to achieve what you want for the grid containing child data.

Hope to help.

Dennis
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform