Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Skip record in child table
Message
De
10/11/2003 18:44:15
 
 
À
10/11/2003 12:00:29
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00848202
Message ID:
00848534
Vues:
17
I have tried that on my Form and no result.
Maybe I didn't describe the problem.
I have GRID on a table that RecordSource = "ChildTable", LInkMaster = "PrrentTable" and RelationalExpr = "Parent_ID".
I have two buttons on a Form that do SKIP 1 and SKIP -1 in a ChildTable.
Now, problem is that Grid is showing only child records that are related to parent ID and that's ok, but when for example I do SKIP 1 when in the Grid is the last row then record goes beyond that relation and goes to record in ChildTable that is related to next Parent_ID in ParentTable.
I don't want that, and I wan't to solve that.

>>I have Form with Parent and Child table linked with Relation.
>>When I do SKIP 1 for child table it moves to next record regardless of a relation with a parent table.
>>I want to do SKIP in Child table only with records that are related to Parent table.
>>How?
>
>You want a one-to-many relationship, but the default of SET RELATIONS is one-to-one. Use the SET SKIP TO command in combination with the SET RELATION command to do what you want. For example, try the following program (assuming you've installed the sample data):
>
>CLOSE DATABASES ALL
>USE (HOME()+'SAMPLES\TASTRADE\DATA\Orders.DBF') IN 0
>USE (HOME()+'SAMPLES\TASTRADE\DATA\OrdItems.DBF') IN 0 ORDER Order_ID
>SELECT Orders
>SET RELATION TO Order_ID INTO OrdItems
>SET SKIP TO OrdItems
>SCAN FOR Order_ID = "     2"
>  ?OrdItems.Order_ID, OrdItems.Product_ID, OrdItems.Quantity
>ENDSCAN
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform