Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Skip record in child table
Message
From
10/11/2003 18:44:15
 
 
To
10/11/2003 12:00:29
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00848202
Message ID:
00848534
Views:
16
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
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform